Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Problem with preprocessor definitions(only predefined variables seem to work)
Problem with preprocessor definitions [message #673590] Tue, 24 May 2011 08:17 Go to next message
r0dy  is currently offline r0dy Friend
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 Go to previous message
Axel Mueller is currently offline Axel MuellerFriend
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
Previous Topic:Problem installing CDT in classic eclipse
Next Topic:Problem with debugger
Goto Forum:
  


Current Time: Thu Apr 25 08:54:14 GMT 2024

Powered by FUDForum. Page generated in 0.02986 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top