Problem with preprocessor definitions [message #673590] |
Tue, 24 May 2011 08:17 |
r0dy Messages: 1 Registered: May 2011 |
Junior Member |
|
|
Hi
I use Eclipse to develop a c++ project on winxp.
I compile it for local testing with MinGW g++ in debug mode,
and with Cygwin g++ in release mode cause our target platform is a linux.
It works fine, but there's something strange.
When I set the DEBUG symbol in project properties > C/C++ Paths and Symbols > Symbols and then test a #ifdef DEBUG instruction, i get that DEBUG is undefined.
If I do instead an #ifdef with any "built-in values" like WIN32, WINNT, __cplusplus, i get that they are defined.
I tried with other variable names like _DEBUG or __DEBUG, same, undefined.
So here in my case I use #ifdef WIN32 instead cause i use the win32 build as debug, but is there something I missed to make my own variables work ?
|
|
|
Re: Problem with preprocessor definitions [message #673905 is a reply to message #673590] |
Wed, 25 May 2011 06:56 |
Axel Mueller Messages: 1973 Registered: July 2009 |
Senior Member |
|
|
You should use different build configurations for your Debug and Release build. In addition, you should configure the indexer to use the active build configuration (see Preferences->C/C++_>Indexer).
Quote:When I set the DEBUG symbol in project properties > C/C++ Paths and Symbols > Symbols
Which language scope did you use (you can have different defines for C, C++ and asm)?
Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
|
|
|
Powered by
FUDForum. Page generated in 0.02986 seconds