This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Trying to build a shared library on solaris using gcc
- From: "Prasanna Katta" <Prasanna dot Katta at theice dot com>
- To: "Muthukumar R" <muthu at iqmail dot net>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: Mon, 28 Apr 2003 13:16:38 -0400
- Subject: RE: Trying to build a shared library on solaris using gcc
Muthukumar,
Thanks for replying to my question.
I tried the following link line:
ld -G -z text -B symbolic -shared -o mine.so -fPIC -h mine.so mine.o ./include/gciualib.o /usr/lib/abc.so -L/usr/local/lib -ldl -lm -lsocket -lnsl -lc -lrt -lpthread
I got the following messgage:
"ld: warning: option -h appears more than once, first setting taken"
Thanks.
-----Original Message-----
From: Muthukumar R [mailto:muthu at iqmail dot net]
Sent: Monday, April 28, 2003 12:51 PM
To: Prasanna Katta
Cc: gcc-help at gcc dot gnu dot org
Subject: Re: Trying to build a shared library on solaris using gcc
>
> COMPILATION:
> gcc -c -fPIC -DUNIX -DSOLARIS_GCC -I./include mine.c
>
> LINK:
> ld -G -z text -B symbolic -o mine.so -fPIC -h mine.so mine.o ./include/gciualib.o /usr/lib/abc.so -L/usr/local/lib -ldl -lm -lsocket -lnsl -lc -lrt -lpthread
>
I think you need -shared here.