Solved: Help with this compile error

Posted by Scott on Stack Overflow See other posts from Stack Overflow or by Scott
Published on 2010-06-15T05:44:00Z Indexed on 2010/06/15 7:12 UTC
Read the original article Hit count: 210

Filed under:
|

I just picked up an old project and I'm not sure what the following error could mean.

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:

At line 24 of BufferedReader.cpp is #include <string.h>. I've tried it with just <string> but get the same thing. Any clue?

Here's the snippet of code from 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

Does that mean __GNUC_PREREQ isn't defined?

Edit:

Changing -Ijsoncpp/include/json/ to Ijsoncpp/include stopped the errors. I noticed I was including <json/json.h>.

I'm about to switch to JsonGlib though, which is the reason I pulled the project up again. So it's all good. :)

© Stack Overflow or respective owner

Related posts about c++

Related posts about linux