Menu

#166 need to link against -lCstd -lCrun on Solaris

open
nobody
5
2005-05-11
2005-05-11
No

when compiling on Solaris using Sun Studio's C++
compiler, shared libraries do not get the C++ runtime
library linked implicitly (unlike gcc). this means
that when id3lib is used in a C program, runtime shared
linking fails because the C++ standard library
dependencies are not found. from the CC manpage:

When you use the -G option, the compiler does not
pass any default -l options to ld. If you want the
shared library to have a dependency on another
shared library, you must pass the necessary -l
option on the command line. For example, if you
want the shared library to be dependent upon lib-
Crun, you must pass -lCrun on the command line.

the solution is to pass -lCstd -lCrun to the linker
when linking.

tested with:
id3lib 3.8.3
SunOS rose.local 5.10 Generic_118844-01 i86pc i386 i86pc
CC: Sun C++ 5.7 2005/03/03

Discussion


Log in to post a comment.