From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.3) Gecko/20041020 Firefox/0.10.1 Description of problem: there appears to be errors in files: bits/stl_bvector.h bits/vector.tcc i needed to replace all 'std::max' appearances to 'max' Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. compile a .cpp file that uses include <vector> 2. 3. Additional info:
Please include small self-contained testcase which shows what problem do you see. Compiling a .cpp file that includes <vector> certainly works for me (and there are thousands of them already in the distribution itself).
sorry, it does'nt happen on each .cpp it happens when i try to compile "stage 1.3.4" from the "player/stage" project (playerstage.sourceforge.net) this is the error: g++ -DHAVE_CONFIG_H -I. -I. -I.. -Wall -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -I/usr/local/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -O2 -c library.cc In file included from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/vector:72, from models/bitmap.hh:18, from library.cc:32: /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/bits/stl_bvector.h: In member function `void std::vector<bool, _Alloc>::_M_insert_range(std::_Bit_iterator, _ForwardIterator, _ForwardIterator, std::forward_iterator_tag)':/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/bits/stl_bvector.h:522: error: expected unqualified-id before '(' token In file included from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/vector:75, from models/bitmap.hh:18, from library.cc:32: /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/bits/vector.tcc: In member function `void std::vector<_Tp, _Alloc>::_M_fill_insert(__gnu_cxx::__normal_iterator<typename _Alloc::pointer, std::vector<_Tp, _Alloc> >, size_t, const _Tp&)': /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/bits/vector.tcc:307: error: expected unqualified-id before '(' token
Please rerun the above command with -E -dD instead of -c and attach here its output.
Created attachment 106476 [details] output of g++ command with -E -dD parameters
It is a bug in the code you are compiling. /usr/local/include/playercommon.h has: #define min(a,b) ((a) < (b) ? (a) : (b)) #define max(a,b) ((a) > (b) ? (a) : (b)) and the .cc file in question first includes <map>, then defines these macros and then includes <vector>. You can't do this in C++, max is <vector> and other header's reserved identifier.