I have a little problem running the most simple of
c++-programms. a call to 'cout' gives me a SEGFAULT.
gdb comes back with the following:
Program received signal SIGSEGV, Segmentation fault.
0x0 in ?? ()
in the line of the first call to cout::operator<<()
(line 4 in the prg below)
I am running the following system:
Linux 1.3.45
libc.so.5.2.16
libiostream.so.26.2.5
I first saw this in a real program of mine so I tested helloWorld.cc
in order to see wether the mistake is mine or the libs, but it apeared
in helloWorld as well as in my prg.
I tried to compile helloWorld.cc with
gcc -g helloWorld.cc -liostream
as well as
gcc -g helloWorld.cc /usr/lib/libiostream.a
each compiled fine, but execuing a.out gave the same SEGFAULT each time.
Could you help me see if this is a problem of mine alone or a bug in the
iostream-lib
Please dont't flame too bright in case I am just unable to write decent
c++ =B-)
mfg lutz
the programm that I am talking about is the following:
1: #include <iostream.h>
2: main (int argc, char* argv[])
3: {
4: cout<<"Hello World"<<endl;
5: cout<<argc<<endl;
6: cout<<argv[0]<<endl;
7: }
Lutz Behnke, l...@maz-hh.de, behn...@informatik.fh.hamburg.de
[wrong newsgroup, but anyway...]
>I have a little problem running the most simple of
>c++-programms. a call to 'cout' gives me a SEGFAULT.
> Linux 1.3.45
> libc.so.5.2.16
> libiostream.so.26.2.5
libiostream is no longer needed as of libc 5.2.16. Just get
libg++-2.7.0.2 and link with -lstdc++ rather than -liostream.
Regards,
Wolfram.