LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 01-13-2003, 06:30 AM   #1
finidi
Member
 
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:

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

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

and

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
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,537

Rep: Reputation: 149Reputation: 149
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
GtkUser
Member
 
Registered: Sep 2002
Location: Canada
Distribution: Redhat 9.0
Posts: 637

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



#include<list>
#include<vector>

using std::list;
using std::vector;
 
Old 01-14-2003, 06:55 AM   #4
finidi
Member
 
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 !!!
 
  


Reply


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


All times are GMT -5. The time now is 06:33 PM.

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