Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I tried to install install one program at Ubuntu and it uses main.cpp .I dont know why but it gives always error.(main.cpp syntax correct 100%) and this program works without error @Mac system but not ubuntu.I couldnt know to how to fix it.Please can you help that issue?

g++ version : g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

Error below:

g++ -O2 -g -Wall -fmessage-length=0 -I/usr/include/mysql    -c -o main.o main.cpp
In file included from /usr/include/c++/4.6/sstream:580:0,
                 from /usr/local/include/glog/logging.h:44,
                 from main.cpp:13:
/usr/include/c++/4.6/bits/sstream.tcc: In member function ‘virtual std::basic_stringbuf<_CharT, _Traits, _Alloc>::int_type std::basic_stringbuf<_CharT, _Traits, _Alloc>::overflow(std::basic_stringbuf<_CharT, _Traits, _Alloc>::int_type)’:
/usr/include/c++/4.6/bits/sstream.tcc:112:39: error: expected unqualified-id before ‘(’ token
/usr/include/c++/4.6/bits/sstream.tcc:114:35: error: expected unqualified-id before ‘(’ token
make: *** [main.o] Error 1
share|improve this question
    
Please post the relevant lines from sstream.h, main.cpp, etc –  poolie Jun 17 '13 at 8:20
add comment

1 Answer

up vote 2 down vote accepted

A Google search for that error message suggests this is caused by a macro max interfering with code in sstream.h. Try adding these lines just above where it is included in main.cpp:

#undef max
#undef min
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.