In C++ CodeBlocks project I added the following definitions to the project settings, compiler settings, #define:
_DEBUG DATA_DIR=\"/media/Shared/SiX/Data\"
This produces 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 is not compiled:
char* commonDataDir; #ifdef DATA_DIR commonDataDir = DATA_DIR; #endif
Looking at preprocessor output file, I see that source code line is expanded by this way:
commonDataDir = /media/Shared/SiX/Data;
I expect:
commonDataDir = "/media/Shared/SiX/Data";
The same code is compiled correctly from 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"
So, the same command line parameter is handled differently by g++ proprocessor. How can I fix this?