By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,171 Members | 1,037 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,171 IT Pros & Developers. It's quick & easy.

Problems compiling STLPORT 4.5.3 with g++ 3.3

P: n/a
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.

Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.