我剛拿起一箇舊項目,我不確定下面的錯誤可能意味着什麼。幫助解決這個編譯錯誤
g++ -o BufferedReader.o -c -g -Wall -std=c++0x -I/usr/include/xmms2 -Ijsoncpp/include/json/ -fopenmp -I/usr/include/ImageMagick -I/usr/include/xmms2 -I/usr/include/libvisual-0.4 -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_SCRIPT_LIB -DQT_SHARED -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtScript BufferedReader.cpp
In file included from BufferedReader.cpp:23:
/usr/include/string.h:36:42: error: missing binary operator before token "("
In file included from /usr/lib/gcc/i686-redhat-linux/4.4.3/../../../../include/c++/4.4.3/cwchar:47,
from /usr/lib/gcc/i686-redhat-linux/4.4.3/../../../../include/c++/4.4.3/bits/postypes.h:42,
from /usr/lib/gcc/i686-redhat-linux/4.4.3/../../../../include/c++/4.4.3/iosfwd:42,
from /usr/lib/gcc/i686-redhat-linux/4.4.3/../../../../include/c++/4.4.3/ios:39,
from /usr/lib/gcc/i686-redhat-linux/4.4.3/../../../../include/c++/4.4.3/istream:40,
from /usr/lib/gcc/i686-redhat-linux/4.4.3/../../../../include/c++/4.4.3/sstream:39,
from BufferedReader.cpp:24:
在BufferedReader.cpp的第24行是#include <string.h>
。我試過了,只是<string>
,但得到同樣的東西。任何線索?
這裏的代碼文件string.h
/* Tell the caller that we provide correct C++ prototypes. */
#if defined __cplusplus && __GNUC_PREREQ (4, 4) //line 36
# define __CORRECT_ISO_CPP_STRING_H_PROTO
#endif
這是否意味着__GNUC_PREREQ片斷沒有定義?
編輯:
更改-Ijsoncpp/include/json/
到Ijsoncpp/include
停止錯誤。我注意到我包括<json/json.h>
。
雖然我即將切換到JsonGlib,這也是我將項目再次拉上來的原因。所以這都很好。 :)
** @ Scott *要遵循指南,請將您的解決方案作爲實際答案發布,然後接受它。將您的解決方案編輯到您的問題中會讓用戶更難以理解接受的答案。 – 2011-03-15 01:01:02