Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-13-2003, 06:30 AM   #1
Registered: Dec 2002
Location: World
Distribution: Fedora Core 4
Posts: 127

Rep: Reputation: 15
Unhappy gcc STL include problem

With gcc 2.95 an app was compiling OK (0 errors 0 warnings)... after the last upgrade to my system, gcc version now is 3.2 (Linux Red Hat 8.0), and start to receive many errors and warnings compiling that app...the only way I've found to build it is:

#include <list.h>
#include <stack.h>
#include <vector.h>

instead of
#include <list>
#include <stack>
#include <vector>


2) CFLAGS=-Wno-deprecated

in the makefile.

Otherwise receive the warnings about deprecated headers OR sintactic errors when declaring an STL object.

Any help will be appreciated.
Old 01-13-2003, 02:45 PM   #2
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,571

Rep: Reputation: 180Reputation: 180
The thing is that GCC version 3+ has more strict rules when parsing. It just don't accept some constructions that were possible in earlier versions. Your solution is 100% correct.
Old 01-13-2003, 04:14 PM   #3
Registered: Sep 2002
Location: Canada
Distribution: Redhat 9.0
Posts: 637

Rep: Reputation: 30
Provide more code. Using .h is not correct.


using std::list;
using std::vector;
Old 01-14-2003, 06:55 AM   #4
Registered: Dec 2002
Location: World
Distribution: Fedora Core 4
Posts: 127

Original Poster
Rep: Reputation: 15
Now it's all OK... many thanks to both.

I have to say the way finally I did... replaced all the .h headers with their c++ counterparts, and just added:

using namespace std;

with that, all goes as before the upgrade, but with the standard c++ headers.

Thanks again !!!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add boost libraries to gcc include list kiku Linux - Newbie 1 03-04-2005 02:49 PM
gcc include apocolpse Programming 6 11-03-2004 01:36 PM
GCC + STL Compile Problem Hairein Programming 6 09-23-2004 08:43 AM
gcc on 9.1 include problem skywarp Slackware 3 06-04-2004 10:05 PM
GCC include path. jwilson Linux - General 1 04-02-2001 03:58 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:00 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration