[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Offtopic] C++-coded-packages



Jason Gunthorpe <jgg@gpu.srv.ualberta.ca> writes:

> That reminds me, why do a number of programs use libg++ when they never
> call any of the special GNU C++ functions?

g++ links in libg++ and stdc++ by default.  Link with gcc to prevent
this.

$ cat a.cc
#include <iostream.h>
int main() { cout << "hello, world\n"; }
$ g++ -c a.cc
$ g++ a.o
$ ldd a.out
        libg++.so.272 => /usr/lib/libg++-dbg/libg++.so.272 (0x4000e000)
        libstdc++.so.272 => /usr/lib/libg++-dbg/libstdc++.so.272 (0x40047000)
        libm.so.6 => /lib/libm.so.6 (0x4007e000)
        libc.so.6 => /lib/libc.so.6 (0x40097000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
$ ./a.out
hello, world
$ gcc a.o -lstdc++
$ ldd a.out
        libstdc++.so.272 => /usr/lib/libg++-dbg/libstdc++.so.272 (0x4000e000)
        libc.so.6 => /lib/libc.so.6 (0x40045000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
$ ./a.out
hello, world


Guy


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: