The C++ runtime libraries are intended to be linked by the C++ compiler, and 
the compiler has the symlinks in its installation area. At program run time, 
the .so symbolic links are not used.

That is, when you have -lCstd on the CC command line (implicitly or 
explicitly), the linker finds the symbolic libCstd.so, follows the link, and 
creates a dependency on the libCstd.so.1 that the link points to. At program 
run time, the dependency on that library is used, not the symlink.

Linking a C++ program using ld directly is generally a very bad idea. The exact 
set of files and the exact link order depend on the set of options on the 
command line, and also to some degree on the compiler version. There is no 
one-size-fits-all set of options that you can use with ld.

If you are using a generator script to create command lines for programs 
compiled with Sun C++, tell it to use CC, not ld, for linking, and remove from 
the command line the hidden files that CC links implicitly.

Steve Clamage
Sun C++ compiler team
-- 
This message posted from opensolaris.org

Reply via email to