[SunHELP] Generating shared libraries

René Berber r.berber at computer.org
Wed Feb 8 09:19:18 CST 2006


Miguel Cardenas wrote:

> The idea of installing solaris was to port a library am developing,
originally
> was created for linux, was ported to freebsd and now want to port it to
> solaris...
>
> Currently the code has been ported with a few modifications, but the problem
> is linking, the 'ld' is a bit different than in linux or freebsd and the man
> page did not help me too much to understand how to use it...
>
> The question is... where can I find a tutorial or note or samples to build
> shared libraries?? just need a few samples and notes.
>
> The link command I used in linux and freebsd was
>
> gcc -shared -Wl,-soname,libv2.so.$VOODOO2_MAJOR \
>     -o libv2.so.$VOODOO2_MAJOR.$VOODOO2_MINOR \
>     exceptions.o signal.o \
>     voodoo.o voodoo_cgi.o voodoo_crypt.o voodoo_daemon.o voodoo_dynlib.o
> voodoo_email.o voodoo_irc.o voodoo_sockets.o
>
> but in solaris returns a message that '-o' is defined two times and don't
know
> why.

It is defined twice (and different each time), just take out the
"-Wl,-soname,libv2.so.$VOODOO2_MAJOR" part and it should compile.

> Anybody knows a tutorial or article?

gcc under Solaris usually relies on Sun's ld, so "man ld" is the reference or
try http://developers.sun.com/prodtech/solaris/
--
Reni Berber



More information about the SunHELP mailing list