* Re: Linux, streams and the standard library
2001-04-29 17:43 Linux, streams and the standard library John Beardmore
@ 2001-04-29 17:02 ` Neil Butterworth
2001-04-29 19:54 ` Philip Armstrong
2001-04-29 20:22 ` John Beardmore
2001-04-29 18:28 ` David Konerding
1 sibling, 2 replies; 9+ messages in thread
From: Neil Butterworth @ 2001-04-29 17:02 UTC (permalink / raw)
"John Beardmore" <wookie@wookie.demon.co.uk> wrote in message
news:WvwRxWTNLF76Ew5r@wookie.demon.co.uk...
[snip]
>
> So - a couple of questions:
>
> 1) is there a way to get ostringstream to work ?
Yes - use STLport. You can download it from www.stlport.org.
> 2) is the Standard C++ library ready for prime time under Linux ?
> Isn't its
> use utterly routine these days ? Or am I trying to be too modern ?
No, I've been using it for quite some time with absolutely no problems. Not
under RedHat though - I run SuSE.
[snip]
NeilB
^ permalink raw reply [flat|nested] 9+ messages in thread
* Linux, streams and the standard library
@ 2001-04-29 17:43 John Beardmore
2001-04-29 17:02 ` Neil Butterworth
2001-04-29 18:28 ` David Konerding
0 siblings, 2 replies; 9+ messages in thread
From: John Beardmore @ 2001-04-29 17:43 UTC (permalink / raw)
I'm starting a C++ project which has to compile to form both an MSVC 6
command line application and an RH Linux 6.2 command line application.
I was hoping to use C++ with the Standard Library as described in "The
C++ Programming Language" by Bjarne Stroustrup. WiIl this be
possible ?
I ask, because as soon as I stated adding code to the class skeleton I
found I needed to add a reference to the standard library at link time.
Was I being hopelessly naive in expecting it to be linked by default ?
In the end I found it in:
/usr/lib/gcc-lib/alpha-redhat-linux/egcs-2.91.66/libstdc++.a
but it doesn't seem to be in the default library path so I have to
identify the full path in the Makefile. That stuff now compiles, but is
this normal ?
Now I've added stuff that requires the #include <sstream> according to
Stroustrup. I can find sstream.h, but only in:
/usr/include/linuxconf/sstream.h
which doesn't seem to be in the default include path. When I include
this by giving the full path, the compile fails, complaining that
ostringstream is undeclared, and it does indeed seem to be unmentioned
the linuxconf sstream.h file.
So - a couple of questions:
1) is there a way to get ostringstream to work ?
2) is the Standard C++ library ready for prime time under Linux ?
Isn't its
use utterly routine these days ? Or am I trying to be too modern ?
I'm having no problem getting this stuff to compile under MSVC 6. Have
I missed something obvious under Linux ?
If the compiler that ships with RH6.2 won't do what I need, ( I guess
it must be a year old now ! ), is it simple to upgrade it to a later
gcc that
will ?
If gcc won't work with the standard C++ lib, will the Compaq C for Linux
Alpha compiler be any use ? Will that compiler coexist with the Linux
compiler ? I gather I'd still need that for building kernels !
I've just tried to get an 'on line test drive' to see if the Compaq
compiler would compile my code skeleton, but the link from the Compaq
site is broken.
If I can, I'd rather stay with a standard Linux compiler so that we can
port to Intel Linux if needs be later on.
Cheers, J/.
--
John Beardmore
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Linux, streams and the standard library
2001-04-29 17:43 Linux, streams and the standard library John Beardmore
2001-04-29 17:02 ` Neil Butterworth
@ 2001-04-29 18:28 ` David Konerding
1 sibling, 0 replies; 9+ messages in thread
From: David Konerding @ 2001-04-29 18:28 UTC (permalink / raw)
On Sun, 29 Apr 2001 18:43:41 +0100, John Beardmore <wookie@wookie.demon.co.uk> wrote:
> I'm starting a C++ project which has to compile to form both an MSVC 6
> command line application and an RH Linux 6.2 command line application.
>
> I was hoping to use C++ with the Standard Library as described in "The
> C++ Programming Language" by Bjarne Stroustrup. WiIl this be
> possible ?
>
> So - a couple of questions:
>
> 1) is there a way to get ostringstream to work ?
>
> 2) is the Standard C++ library ready for prime time under Linux ?
> Isn't its
> use utterly routine these days ? Or am I trying to be too modern ?
>
I'm going to save you some time (because I wasted a lot of my own
before learning what the answer was). ostringstream is not supported
with RH6.2's supplied compiler/libraries. Yes, standard C++ library is
ready for prime time under linux, but it's not an out-of-the-box
experience yet. Yes, stndard C++ is utterly routine (on some platforms-
for example, Tru64 and IRIX, as long as you have $$$). It's a bit
"modern" since the specification was only standardized recently, and
software people have to play catch-up.
If you want standard C++ with the standard C++ library on Linux, and
you are using RH 6.2, then download gcc-2.95.3, compile and install it
according to the instructions, then download STLport-4.0 from
www.stlport.org, and install it according to its instructions. Compile
your apps to use the header files from STLport and link against the
STLport library.
The RH6.2 g++ compiler isn't standard C++ compiliant; gcc-2.95.3 is
nearly enough so (more so than MSVC6 by far) for nearly all code.
Worse, the standard C++ libray they included ISN'T standard. It's
pre-standard, with crap like strstream.h. On the other hand, STLport
is an excellent implementation of the standard C++ library.
RH7.1 comes with a modified g++ compiler, its main issue is that the
ABI it uses is incompatible with the standard g++ library and so when
you try to link apps you have a hard time getting everything to work
properly if you use things like exceptions. As long as you stick to
their compiler, everything will work OK (although you'll pull your hair
out trying to get STLport to compile with their compiler due to
locations of some include files, I have solved this problem, drop me a
line if youwant to know the details).
You might run into some problems because the alpha version of linux
tends to be less well-tested than the intel version, and might not
compile as easily.
Dave
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Linux, streams and the standard library
2001-04-29 20:22 ` John Beardmore
@ 2001-04-29 19:47 ` Neil Butterworth
2001-04-30 0:44 ` John Beardmore
0 siblings, 1 reply; 9+ messages in thread
From: Neil Butterworth @ 2001-04-29 19:47 UTC (permalink / raw)
"John Beardmore" <wookie@wookie.demon.co.uk> wrote in message
news:BfLUNkYigH76Ew5f@wookie.demon.co.uk...
> In article <teollrq3a3go72@corp.supernews.co.uk>, Neil Butterworth
> <neil_butterworth@lineone.net> writes
> >"John Beardmore" <wookie@wookie.demon.co.uk> wrote in message
> >news:WvwRxWTNLF76Ew5r@wookie.demon.co.uk...
>
> >> So - a couple of questions:
> >>
> >> 1) is there a way to get ostringstream to work ?
> >
> >Yes - use STLport. You can download it from www.stlport.org.
> >
> >> 2) is the Standard C++ library ready for prime time under Linux ?
> >> Isn't its
> >> use utterly routine these days ? Or am I trying to be too modern
?
> >
> >No, I've been using it for quite some time with absolutely no problems.
Not
> >under RedHat though - I run SuSE.
>
> What compiler version are you using ?
gcc 2.95.2
NeilB
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Linux, streams and the standard library
2001-04-29 17:02 ` Neil Butterworth
@ 2001-04-29 19:54 ` Philip Armstrong
2001-04-29 20:47 ` Rasmus Bøg Hansen
2001-05-08 2:04 ` David Konerding
2001-04-29 20:22 ` John Beardmore
1 sibling, 2 replies; 9+ messages in thread
From: Philip Armstrong @ 2001-04-29 19:54 UTC (permalink / raw)
In article <teollrq3a3go72@corp.supernews.co.uk>,
Neil Butterworth <neil_butterworth@lineone.net> wrote:
>"John Beardmore" <wookie@wookie.demon.co.uk> wrote in message
>news:WvwRxWTNLF76Ew5r@wookie.demon.co.uk...
>
>[snip]
>>
>> So - a couple of questions:
>>
>> 1) is there a way to get ostringstream to work ?
>
>Yes - use STLport. You can download it from www.stlport.org.
Or install gcc-2.95.3 which has ostringstream in its version
of the STL.
>> 2) is the Standard C++ library ready for prime time under Linux ?
>> Isn't its
>> use utterly routine these days ? Or am I trying to be too modern ?
>
>No, I've been using it for quite some time with absolutely no problems. Not
>under RedHat though - I run SuSE.
Indeed. With gcc-2.95.3 the STL support is pretty complete. gcc-3.0
should finish off all the corner cases in the c++ support hopefully.
Phil
--
http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Linux, streams and the standard library
2001-04-29 17:02 ` Neil Butterworth
2001-04-29 19:54 ` Philip Armstrong
@ 2001-04-29 20:22 ` John Beardmore
2001-04-29 19:47 ` Neil Butterworth
1 sibling, 1 reply; 9+ messages in thread
From: John Beardmore @ 2001-04-29 20:22 UTC (permalink / raw)
In article <teollrq3a3go72@corp.supernews.co.uk>, Neil Butterworth
<neil_butterworth@lineone.net> writes
>"John Beardmore" <wookie@wookie.demon.co.uk> wrote in message
>news:WvwRxWTNLF76Ew5r@wookie.demon.co.uk...
>> So - a couple of questions:
>>
>> 1) is there a way to get ostringstream to work ?
>
>Yes - use STLport. You can download it from www.stlport.org.
>
>> 2) is the Standard C++ library ready for prime time under Linux ?
>> Isn't its
>> use utterly routine these days ? Or am I trying to be too modern ?
>
>No, I've been using it for quite some time with absolutely no problems. Not
>under RedHat though - I run SuSE.
What compiler version are you using ?
Cheers, J/.
--
John Beardmore
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Linux, streams and the standard library
2001-04-29 19:54 ` Philip Armstrong
@ 2001-04-29 20:47 ` Rasmus Bøg Hansen
2001-05-08 2:04 ` David Konerding
1 sibling, 0 replies; 9+ messages in thread
From: Rasmus Bøg Hansen @ 2001-04-29 20:47 UTC (permalink / raw)
On 29 Apr 2001, Philip Armstrong wrote:
> In article <teollrq3a3go72@corp.supernews.co.uk>,
> Neil Butterworth <neil_butterworth@lineone.net> wrote:
> >"John Beardmore" <wookie@wookie.demon.co.uk> wrote in message
> >news:WvwRxWTNLF76Ew5r@wookie.demon.co.uk...
> >
> >[snip]
> >>
> >> So - a couple of questions:
> >>
> >> 1) is there a way to get ostringstream to work ?
> >
> >Yes - use STLport. You can download it from www.stlport.org.
>
> Or install gcc-2.95.3 which has ostringstream in its version
> of the STL.
>
> >> 2) is the Standard C++ library ready for prime time under Linux ?
> >> Isn't its
> >> use utterly routine these days ? Or am I trying to be too modern ?
> >
> >No, I've been using it for quite some time with absolutely no problems. Not
> >under RedHat though - I run SuSE.
>
> Indeed. With gcc-2.95.3 the STL support is pretty complete. gcc-3.0
> should finish off all the corner cases in the c++ support hopefully.
In RedHat 6.2 there was some egcs (1.1.2 I think). I think it is the gcc
2.91.66 one. I don't know how complete the STL support was thence.
Rasmus
--
-- [ Rasmus 'M�ffe' B�g Hansen ] --------------------------------------
If a trainstation is the place where trains stop, what is a workstation?
----------------------------------------- [ Remove 'spam' to reply ] --
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Linux, streams and the standard library
2001-04-29 19:47 ` Neil Butterworth
@ 2001-04-30 0:44 ` John Beardmore
0 siblings, 0 replies; 9+ messages in thread
From: John Beardmore @ 2001-04-30 0:44 UTC (permalink / raw)
In article <teovbc1421u509@corp.supernews.co.uk>, Neil Butterworth
<neil_butterworth@lineone.net> writes
>"John Beardmore" <wookie@wookie.demon.co.uk> wrote in message
>news:BfLUNkYigH76Ew5f@wookie.demon.co.uk...
>> >> So - a couple of questions:
>> >>
>> >> 1) is there a way to get ostringstream to work ?
>> >
>> >Yes - use STLport. You can download it from www.stlport.org.
OK, I'll try that when a get 2.95.3 running.
>> >> 2) is the Standard C++ library ready for prime time under Linux ?
>> >> Isn't its
>> >> use utterly routine these days ? Or am I trying to be too modern
>?
>> >
>> >No, I've been using it for quite some time with absolutely no problems.
>Not
>> >under RedHat though - I run SuSE.
>>
>> What compiler version are you using ?
>
>gcc 2.95.2
OK, pretty recent then !
Cheers, J/.
--
John Beardmore
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Linux, streams and the standard library
2001-04-29 19:54 ` Philip Armstrong
2001-04-29 20:47 ` Rasmus Bøg Hansen
@ 2001-05-08 2:04 ` David Konerding
1 sibling, 0 replies; 9+ messages in thread
From: David Konerding @ 2001-05-08 2:04 UTC (permalink / raw)
On 29 Apr 2001 20:54:46 +0100, Philip Armstrong <phil@kantaka.co.uk> wrote:
> In article <teollrq3a3go72@corp.supernews.co.uk>,
> Neil Butterworth <neil_butterworth@lineone.net> wrote:
>>"John Beardmore" <wookie@wookie.demon.co.uk> wrote in message
>>news:WvwRxWTNLF76Ew5r@wookie.demon.co.uk...
>>
>>[snip]
>>>
>>> So - a couple of questions:
>>>
>>> 1) is there a way to get ostringstream to work ?
>>
>>Yes - use STLport. You can download it from www.stlport.org.
>
> Or install gcc-2.95.3 which has ostringstream in its version
> of the STL.
>
>>> 2) is the Standard C++ library ready for prime time under Linux ?
>>> Isn't its
>>> use utterly routine these days ? Or am I trying to be too modern ?
>>
>>No, I've been using it for quite some time with absolutely no problems. Not
>>under RedHat though - I run SuSE.
>
> Indeed. With gcc-2.95.3 the STL support is pretty complete. gcc-3.0
> should finish off all the corner cases in the c++ support hopefully.
Not entirely true. STL support may be nearly complete (thanks to SGI)
but the standard library isn't. STL is just a part of the standard library
and ostringstream isn't part of STL (it's part of IOStreams). I've been playing with
gcc-2.95.3 ad gcc-3.0pre (from CVS) to test their standard C++ library. It's far
from as good as STLport. I get segfaults when using ostringstreams heavily--
I ran out of time figuring out the minimal test case which reproduces the problem, mailing them in, waiting for them
to be patched, downloading new versions of the compiler, recompiling
the compiler and the library (1-2 hrs on a fast machine!), repeat. THat's why I responded earlier
saying "I'm going to save you a lot of time" because 2.95.3 + STLport-4.0 is really stable & solid.
I did spend a couple weeks chasing a really tricky bug which we were certain was STLport-4.0 but
actually turned out to be a problem with the run time linker (if you make a C app that dlopen()s two
shared object files, each of which is linked dynamically gainst STLport shared library,
you get crashes in IOStreams, because the run-time linker doesn't resolve symbols properly when
it loads the second .so. The main C app (python) specifically does not like havig RTLD_GLOBAL set
when it dlopen()s the .so's, so it's not surprising we have this behavior (what's surprising
is that IRIX and Tru64 don't have this "problem". We had to work
around it using LD_PRELOAD-- yecch). But C++ dlls that get loaded
into C programs are fairly esoteric, hopefully not an issue for most programmers.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2001-05-08 2:04 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-29 17:43 Linux, streams and the standard library John Beardmore
2001-04-29 17:02 ` Neil Butterworth
2001-04-29 19:54 ` Philip Armstrong
2001-04-29 20:47 ` Rasmus Bøg Hansen
2001-05-08 2:04 ` David Konerding
2001-04-29 20:22 ` John Beardmore
2001-04-29 19:47 ` Neil Butterworth
2001-04-30 0:44 ` John Beardmore
2001-04-29 18:28 ` David Konerding
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox