At 10:33 AM -0800 3/27/01, Horace Ho wrote:
>Code Warrior 4.1.0.2 build 0646
>
>Added a #define XYZ in a .h file to the "Prefix File" field, under
>C/C++ Language in project settings.
>
>However, codes between the:
>
>#ifdef XYZ
>// ... codes here
>#endif
>
>section in the .c source file are ignored.
>
>If I added the #define XYZ to the .c source file, the compiler returns
>an "Macro redefinition" error.
>
>If I remove the #define XYZ from the .h file but only add #define XYZ
>in the .c file, the #ifdef ... #endif section is working.

Just to be certain I understand correctly... you did NOT type this #define into the 
field of the CodeWarrior C/C++ panel which specifies the prefix file name to use, but 
rather, you've added  #define XYZ  to the CONTENTS of the prefix file specified in the 
CodeWarrior C/C++ panel... yes? For every target in the project?

Did you try putting some uncompilable garbage characters in your .h and .c files 
within your #ifdef...#endif directives to see if the prefix file is being parsed 
correctly or not? The compiler should complain when it hits those garbage characters 
if the #define is being activated correctly.

Regards,

Jim Schram
Palm Incorporated
Partner Engineering


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to