Advertisement

How to determine whether OpenAL is installed?

Started by October 26, 2016 09:00 PM
4 comments, last by Shaarigan 8 years, 1 month ago

Hello everybody

How can I determine whether OpenAL is installed? Is there a #define equivalent of _WIN32?

Thanks

You cannot detect if third-party libraries are installed from inside C++.

You'll need to use an installer script or a build tool like Premake/CMake/etc. and detect third-party libraries prior to compilation.

Sean Middleditch – Game Systems Engineer – Join my team!

Advertisement

I could be wrong but I think he means after compilation.

-potential energy is easily made kinetic-

@Infinisearch

No, I am doing conditional compilation using preprocessor directives and wondered whether I can detect, at compile time, if OpenAL is installed.

Nope. Instead, you should expose an option to build with OpenAL support. See SeanMiddleditch’s response.
You could write a short program or preprocessor module that seeks for OpenAL by using LoadLibrary or the linux one operation to get a pointer to it. If you get a pointer that is not null then you have OpenAL found and return some kind of int code to indicate that, then either using buildfiles or the prebuild events in MS Visual Studio to e.g. replace a config file with the specific one setting the PP macro correctly

This topic is closed to new replies.

Advertisement