Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: drev on April 07, 2009, 01:05:04 pm

Title: Conditional static library link
Post by: drev on April 07, 2009, 01:05:04 pm
Hi,

I have a projet with some features that can be enabled/disabled using the preprocessor

Code

#define FOO  <-- passed with -DFOO or in #defines textarea at the build option menu

#ifdef FOO
#include <foo.h>
#endif

Question : how does it works for link with a static library (assumed -lfoo) if FOO is defined ?
I think a #pragma link is used in visual studio but I am not sure it is supported/safe with gcc C99.
Title: Re: Conditional static library link
Post by: Jenna on April 07, 2009, 01:19:05 pm
Read the gcc manual or ask in an appropriate forum !!

This forum is dedicated to C::B related questions only !

Topic locked !