[ale] c++, dynamic linking etc.

Alan Stewart astewart at layton-graphics.com
Tue Feb 10 10:22:23 EST 2004

I thought dynamic linking was the default. My ldd output (compiling with 
g++/gcc 2.96) looks like this:

        libz.so.1 => /usr/lib/libz.so.1 (0x40031000)
        libtiff.so.3 => /usr/lib/libtiff.so.3 (0x40040000)
        libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3 
        libm.so.6 => /lib/i686/libm.so.6 (0x400c6000)
        libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
        libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x400e8000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

Bjorn Dittmer-Roche wrote:

>Hey all,
>I've compiled a c++ program and ran ldd on it:
>        libm.so.6 => /lib/libm.so.6 (0x40023000)
>        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40045000)
>        libpthread.so.0 => /lib/libpthread.so.0 (0x4004d000)
>        libc.so.6 => /lib/libc.so.6 (0x4009d000)
>        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
>I expect (and want) to see libstdc++, but I don't. Is it being statically
>linked? How can I avoid that? I've looked at the gcc manual and all I can
>find is stuff about using NO standard libraries, which makes it very
>difficult to compile things. So, how can I make sure libraries are
>dynamically linked?
>Ultimately what I'm trying to do, BTW, is release a program in binary form
>only without violating (L)GPL, but I also want it to be compatible with as
>many distro's as possible.


D. Alan Stewart
Senior Software Developer
Layton Graphics, Inc.
155 Woolco Drive
Marietta, GA 30065
Voice: 770/973-4312
Fax: 800/367-8192

More information about the Ale mailing list