Problems compiling STLPORT 4.5.3 with g++ 3.3

G

Gary

I am trying to compile the STLPORT 4.5.3 using g++ 3.3 compiler on sun. I
have modified the stl_gcc.h file to point to the correct include path for
the compiler.
I am getting the following errors:
In file included from /opt/nortel/gcc-3.3/backward/iostream.h:31,
from /export/home/rch034/garyla/stlport/wrap_std/h/iostream.h:5,
from /export/home/rch034/garyla/stlport/iostream.h:107,
from /export/home/rch034/garyla/stlport/wrap_std/iosfwd:64,
from /export/home/rch034/garyla/stlport/iosfwd:45,
from /export/home/rch034/garyla/stlport/stl/_string_fwd.h:23,
from /export/home/rch034/garyla/stlport/stl/_string.h:31,
from /export/home/rch034/garyla/stlport/string:42,
from MmapAlloc.h:156,
from MmapAlloc.C:2:
/opt/nortel/gcc-include/c++/3.3/backward/backward_warning.h:32:2: warning:
#warning This file includes at least one deprecated or antiquated header.
Please consider using one of the 32 headers found in section 17.4.1.2 of the
C++ standard. Examples include substituting the <X> header for the <X.h>
header for C++ includes, or <sstream> instead of the deprecated header
<strstream.h>. To disable this warning use -Wno-deprecated.
In file included from
/export/home/rch034/garyla/stlport/wrap_std/h/iostream.h:10,
from /export/home/rch034/garyla/stlport/wrap_std/iostream:30,
from /export/home/rch034/garyla/stlport/iostream:80,
from /opt/nortel/gcc-3.3/include/c++/3.3/backward/iostream.h:32,
from /export/home/rch034/garyla/stlport/wrap_std/h/iostream.h:5,
from /export/home/rch034/garyla/stlport/iostream.h:107, from
/export/home/rch034/garyla/stlport/wrap_std/iosfwd:64,
from /export/home/rch034/garyla/stlport/iosfwd:45,
from /export/home/rch034/garyla/stlport/stl/_string_fwd.h:23, from
/export/home/rch034/garyla/stlport/stl/_string.h:31,
from /export/home/rch034/garyla/stlport/string:42,
from MmapAlloc.h:156,
from MmapAlloc.C:2:
/export/home/rch034/garyla/stlport/using/h/iostream.h:1: error: `istream'
not declared
/export/home/rch034/garyla/stlport/using/h/iostream.h:2: error: `ostream'
notdeclared
/export/home/rch034/garyla/stlport/using/h/iostream.h:6: error: `cin' not
declared
/export/home/rch034/garyla/stlport/using/h/iostream.h: error: `cout' not
declared
/export/home/rch034/garyla/stlport/using/h/iostream.h:12: error: `cerr'
not declared
/export/home/rch034/garyla/stlport/using/h/iostream.h:15: error: `clog'
not declared
/export/home/rch034/garyla/stlport/using/h/iostream.h:18: error: `endl'
not declared
/export/home/rch034/garyla/stlport/using/h/iostream.h:19: error: `ends'
not declared
/export/home/rch034/garyla/stlport/using/h/iostream.h:21: error: `ios' not
declared
/export/home/rch034/garyla/stlport/using/h/iostream.h:22: error: `flush'
not declared

I am not sure how to get fix these errors. I have tried setting the
following defines in the stl_gcc.h file:
//# define _STLP_USE_NEW_IOSTREAMS
//# define _STLP_OWN_IOSTREAMS
//# define _STLP_USE_NO_IOSTREAMS

Setting any one of these flags leads to loads of errors in the
stlport/stl/_string.h file.

I am new to STL and I am trying to port some code to use the g++ compiler
on Sun. I have to use STLPORT 4.5.3 and g++ 3.3. Any help of how to get
around these errors would be greatly appreciated. This code was originally
built on AIX with the IBM C++ compiler and STLPORT 4.5.3.
 
C

Christoph Rabel

Gary wrote:

This is the relevant part of the compiler warning:
/opt/nortel/gcc-include/c++/3.3/backward/backward_warning.h:32:2: warning:
#warning This file includes at least one deprecated or antiquated header.
Please consider using one of the 32 headers found in section 17.4.1.2 of the
C++ standard. Examples include substituting the <X> header for the <X.h>
header for C++ includes, or <sstream> instead of the deprecated header
<strstream.h>. To disable this warning use -Wno-deprecated.

You include the header iostream.h in one of your files which
officially doesnt exist any more. Probably the errors you
get are caused by this header too.

Simply change the #include to:

#include <iostream> // No .h
using namespace std;

The functions are now in the namespace std, so you have to
add the second line too. Its not the very best policy(its
the lazy way of doing it) to make the whole namespace
available and I recommend that you make the functions you
need individually known.

hope this helps,

Christoph
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top