Re: Problem compiling with g++/libc6
I have a later version of g++ than you:
egcs-2.91.60
also when I ldd on the executable, I get
libstdc++-libc6.0-1.so.2 => /usr/lib/libstdc++-libc6.0-1.so.2
(0x4000f000)
libm.so.6 => /lib/libm.so.6 (0x40053000)
libc.so.6 => /lib/libc.so.6 (0x4006e000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
ie I get a libstdc++ which you don't have - maybe this is the problem
(the prog 'works' for me).
The only thing I can think of is do you have support for elf binaries
and/or for old a.out style boundaries. I don't know what these mean,
but I know they are (vaugely relavent) options for the kernel. You
could also try getting a newer version of g++.
Whoops- just read the bottom of you message saying you have egcs-2.91
and it works. I don't know why g++ doesn't use it?
Sorry
Rich
Prashanth Mundkur wrote:
>
> Can someone figure this out? The most trivial C++ program
> crashes. ( main(){} )
>
> The link between the compiler and libc6 seems fishy.
> I have a slink system, with both libstdc++2.8 and
> libstdc++2.9.
>
> ------
> wintermute:test >g++ --version
> egcs-2.90.27 980315 (egcs-1.0.2 release)
>
> wintermute:test >cat /etc/debian_version
> 2.1
>
> wintermute:test >cat a.cc
> main()
> {
> }
>
> wintermute:test >g++ -o a a.cc
> wintermute:test >a
> Segmentation fault
> wintermute:test >ldd a
> libm.so.6 => /lib/libm.so.6 (0x4000b000)
> libc.so.6 => /lib/libc.so.6 (0x40024000)
> ld-linux.so.2 => /lib/ld-linux.so.2 (0x400c9000)
> ----------
>
> The debugger points at libc6:
>
> wintermute:test >gdb a.out
> GNU gdb 4.17.m68k.objc.threads.hwwp.fpu.gnat
> Copyright 1998 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "i486-pc-linux-gnu"...
> (no debugging symbols found)...
> (gdb) break main
> Breakpoint 1 at 0x8048537
> (gdb) run
> Starting program:
> /home/mundkur/qtplot/plot-0.00/test/a.out
> (no debugging symbols found)...
> Program received signal SIGSEGV, Segmentation fault.
> 0x400d291f in ?? () from /lib/libc.so.6
>
> --------------
>
> But, this works:
>
> wintermute:test >egcc --version
> egcs-2.91.60
> wintermute:test>egcc -o a a.cc
> wintermute:test >a
> wintermute:test >ldd a
> libc.so.6 => /lib/libc.so.6 (0x40010000)
> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
>
> Any (non-null :-) pointers appreciated.
>
> --prashanth
>
> --
> Unsubscribe? mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null
Reply to: