makefile - Preprocessors directives have no effect -


i experiencing technical difficulties preprocessor directives :

#ifdef, #define   

i have program built makefile, , have 2 options 2 build : standalone or embedded.
did :

#ifdef _mdimode_    //code embedded #else    //code standalone (default) #endif 

and in main file when compile in embedded purpose wrote :

#define _mdimode_ 

but seems g++ not recognize or understand it. go in else , never compile code embedded version.

infos:
gnu make 3.82
g++ (gcc) 4.6.1 20110908 (red hat 4.6.1-9)
file suffix : .c

this bit of guess without more information. assume code in different file main file. if #define doesn't propagate part of project. have set in file contains code, or in header #included in it.

you can choose set #define in options of compilation command:

g++ -c -d_mdimode_ mycode.c 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -