You are not logged in.
Anyone know if there is a way in C/C++ to check if a particular library (in this case glu) is used to compile?
Offline
autoconf/automake?
Offline
I was thinking about in the source files, with #ifdef or something like it
Offline
Includes with quotes around them? Linker flags? Include directories?
...
Offline
autoconf/automake can do just that, ie check which libraries are available prior to compiling and generate a header file with defines that you include in your source files so you can use #ifdef lib_X.
i don't have much experience with autoconf/automake so i'm not sure how to accomplish this but i know i've seen it done in projects i've tinkered with. i would assume cmake can do this as well, although i've never used it other than to build some software from source i've heard it's much easier to pick up than autoconf/automake, so you may want to look into that first.
Offline
SCons can detect libraries.
Offline
If the libraries use define gaurds, then you can do an #ifdef __FOO_H or whatever it is. Autoconf does do what you want, but you can probably put a similar check in a makefile.
urxvtc / wmii / zsh / configs / onebluecat.net
Arch will not hold your hand
Offline
Use CMake and it's find_package().
Offline
You can't tell at compile time what is going to happen at link time. You also can't find out at compile time if a particular set of header files is around. It's too bad C/C++ doesn't have some kind of "conditional" include that says to include a file if it exists. You just have to use configure or CMake to find out before the user compiles your code.
Offline