http://stackoverflow.com/questions/2410976/how-to-define-a-string-in-gcc-command-line to avoid the shell "eating" the quotes and other characters, you might try single quotes, like this:gcc -o test test.cpp -DNAME='"Mary"' This way you have full control what is defined (quotes, spaces, special characters, and all).