I have CentOS 6.2 (64bit with gcc 4.4.6 as default). Unfortunately, my code only compiles with gcc 3.4.6, so I installed gcc separately (from source) under /home/rajat/local. On linking a simple “Hello World” program, I get the following.
>ldd a.out
linux-vdso.so.1 => (0x00007fff215ff000)
libstdc++.so.6 => /home/rajat/local/lib64/libstdc++.so.6 (0x00007f11853e7000)
libm.so.6 => /lib64/libm.so.6 (0x00000033be400000)
libgcc_s.so.1 => /home/rajat/local/lib64/libgcc_s.so.1 (0x00007f11851ce000)
libc.so.6 => /lib64/libc.so.6 (0x00000033bd000000)
/lib64/ld-linux-x86-64.so.2 (0x00000033bcc00000)
While stdc++ and gcc link to my 3.4.6 libraries, libm and libc still link to default libraries. Is this OK?? The 3.4.6 installation also did not produce libm or libc libraries?
Yes, that’s ok.
The libc/libm is part of glibc, not the gcc compiler. libstdc++ on the other hand ls part of gcc.