This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc-3.2 can not locate stl containers (vector, map, ... etc)


Saeed Eskandari <eskandar at cae dot wisc dot edu> writes:

> Hello,
> I recently upgraded my system from redhat Linux 7.2 with gcc-2.95 to RedHat 
> Linux 8.0 with gcc-3.2 . 
> 
> I have a program which has been compiled and linked by gcc-2.95  without any 
> problem. However after upgrading my system my program no longer compile. 
> 
> I get a lot of compiler error messages, mostly regarding to STL containers and 
> algorithms.  A few lines are as following :
> 
> :210: syntax error before `;' token
> :213: 'string' is used as a type, but is not defined as a type.
> :214: `int UV_ROISize' used prior to declaration
> :224: `QColor*targetLedColor' used prior to declaration
> :229: 'deque' is used as a type, but is not defined as a type.
> :230: 'deque' is used as a type, but is not defined as a type.
> :231: 'deque' is used as a type, but is not defined as a type.
> :232: 'deque' is used as a type, but is not defined as a type.
> :238: 'vector' is used as a type, but is not defined as a type.
> :239: 'vector' is used as a type, but is not defined as a type.
> :240: 'vector' is used as a type, but is not defined as a type.
> 
> I  added the location of the  stl (std)  header files by -I flag but it did 
> not resolve 
> my problem. 
> 
> I appreciate if you share with me your opinion about how to solve this 
> problem.  Please let me know if you need any further information. 
> 
> I just learned that my problem might be because of including std namespace in 
> my program. However my program is relatively big (20K +)  and I do not want 
> prepend any single stl construct with std:: . 
> would  you please suggest  any simple way to resolve this problem without 
> changing my program?

The simplest solution is to put 'using namespace std;' near the top of
    every .cc file, but after the headers have been #included.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]