In the C ++ CodeBlocks project, I added the following definitions to the project settings, compiler settings, #define:
_DEBUG
DATA_DIR = \ "/ media / Shared / SiX / Data \"
This creates the following g ++ command line:
g ++ -Wall -g -fPIC -save-temps -D_DEBUG -DDATA_DIR = \ "/ media / Shared / SiX / Data \" -I ../ Includes -c /media/Shared/SiX/SiXConfiguration/PathManager.cpp -o obj / Debug / PathManager.o
This code does not compile:
char * commonDataDir;
#ifdef DATA_DIR
commonDataDir = DATA_DIR;
#endif
Looking at the output file of the preprocessor, I see that the line of source code is expanded as follows:
commonDataDir = / media / Shared / SiX / Data;
I expect:
commonDataDir = "/ media / Shared / SiX / Data";
The same code compiled correctly from the Eclipse CDT:
g++ -D_DEBUG -DDATA_DIR=\"/media/Shared/SiX/Data\" -I"/media/Shared/SiX (copy)/Includes" -O3 -Wall -c -fmessage-length=0 -fPIC -ggdb -MMD -MP -MF"PathManager.d" -MT"PathManager.d" -o"PathManager.o" "../PathManager.cpp"
, - g++. ?