我写了一个编译多个文件的makefile。执行这样的行时:
g++ -c -Wall -U DEBUG -U FILE -U HighPriority -U OnlyCUDA -U CUDA -U THREAD_NUM -U SIZE -U InputFileName -D FILE -D SIZE=32 -D THREAD_NUM=4 -D CUDA -D InputFileName=input/In32.txt ../src/lib/Globals.cpp -o Globals.o
它会生成大量错误列表:
In file included from /usr/include/wchar.h:36:0,
from /usr/include/c++/4.6/cwchar:46,
from /usr/include/c++/4.6/bits/postypes.h:42,
from /usr/include/c++/4.6/iosfwd:42,
from /usr/include/c++/4.6/ios:39,
from /usr/include/c++/4.6/istream:40,
from /usr/include/c++/4.6/sstream:39,
from /usr/include/c++/4.6/complex:47,
from ../src/lib/../inlcude/Globals.h:3,
from ../src/lib/Globals.cpp:1:
/usr/include/stdio.h:48:25: error: expected unqualified-id before numeric constant
但是当我删除 -D FILE 时它编译得很好。这是怎么回事?
EDIT1:例如,当我使用代码块时,相同的#define FILE 工作正常。为什么这样 ??