How do I pass a quoted string with -D to gcc in cmd.exe?
问题 With gcc (and possibly other compilers as well) it's possible to define a macro outside the source file like so: c:\MinGW\bin\gcc.exe -DDEFINED_INT=45 foo.c -o foo.exe This will define DEFINED_INT to 45 which can be seen when compiling #include <stdio.h> int main() { printf("The define was: %d\n", DEFINED_INT); return 0; } The compiled foo.exe will then print 45 when executed. Now, what I have no clue of is how do I pass a quoted string instead of an int. So, the printf would then be