Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » cdt Code Assist and macros
cdt Code Assist and macros [message #156213] Fri, 14 October 2005 13:58 Go to next message
No real name is currently offline No real nameFriend
Messages: 1
Registered: July 2009
Junior Member
The CDT FAQ says

any macro's necessary to read stdio.h are set (often a missing macro will
cause a system header to encounter a #error in the header file -- for
example on windows using cygwin, the defining the symbol __i386__ will
allow stdio.h to be understood)

unfortunately it is not always aceptable to add a #define to the source
code
many IDEs and editors solve this problem by allow the user to specify a
set of predefined macros, but I failed to locate such a facility in CDT

in othercases compilers predefine macro to indicate which compiler and
version is in play, in my case such a solution would also be acceptable
but I was not able to locate the name of such a macro
if it exists I could add some thing like the following to may files:

#ifdef __ECLIPSE_CDT_COMPILER
#define MY_MACRO
#endif
Re: cdt Code Assist and macros [message #156223 is a reply to message #156213] Fri, 14 October 2005 15:50 Go to previous message
Patrick Turley is currently offline Patrick TurleyFriend
Messages: 43
Registered: July 2009
Member
Jens Odborg wrote:
> The CDT FAQ says
>
> any macro's necessary to read stdio.h are set (often a missing macro
> will cause a system header to encounter a #error in the header file --
> for example on windows using cygwin, the defining the symbol __i386__
> will allow stdio.h to be understood)
> unfortunately it is not always aceptable to add a #define to the source
> code
> many IDEs and editors solve this problem by allow the user to specify a
> set of predefined macros, but I failed to locate such a facility in CDT

This facility exists in the CDT.

-- Open the project properties window.

-- Select C/C++ Include Paths & Symbols.

-- Click on the button labeled Add Preprocessor Symbol.

-- Type in the symbol you want to define, followed optionally by '=' and
the value you want for that symbol.

> in othercases compilers predefine macro to indicate which compiler and
> version is in play, in my case such a solution would also be acceptable
> but I was not able to locate the name of such a macro
> if it exists I could add some thing like the following to may files:
>
> #ifdef __ECLIPSE_CDT_COMPILER
> #define MY_MACRO
> #endif
Previous Topic:Multiple projects on common src directory
Next Topic:debug error viewing linked structs
Goto Forum:
  


Current Time: Thu Dec 26 20:48:51 GMT 2024

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

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

Back to the top