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. |
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.
|
Provide more code. Using .h is not correct.
#include<list> #include<vector> using std::list; using std::vector; |
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 !!! |
All times are GMT -5. The time now is 03:07 PM. |