* Trying to build a shared library on solaris using gcc
@ 2003-04-28 17:02 Prasanna Katta
2003-04-28 17:10 ` Muthukumar R
0 siblings, 1 reply; 3+ messages in thread
From: Prasanna Katta @ 2003-04-28 17:02 UTC (permalink / raw)
To: gcc-help
Hello,
I am trying to build a shared library "mine.so". This shared library uses code in another shared library "abc.so". However when a process tries to load "mine.so", it is not able to do so. The following are my compile and link command lines:
Could somebody tell me what I am doing wrong?
Thanks.
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Trying to build a shared library on solaris using gcc
2003-04-28 17:02 Trying to build a shared library on solaris using gcc Prasanna Katta
@ 2003-04-28 17:10 ` Muthukumar R
0 siblings, 0 replies; 3+ messages in thread
From: Muthukumar R @ 2003-04-28 17:10 UTC (permalink / raw)
To: Prasanna Katta; +Cc: gcc-help
>
> 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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Trying to build a shared library on solaris using gcc
@ 2003-04-28 17:16 Prasanna Katta
0 siblings, 0 replies; 3+ messages in thread
From: Prasanna Katta @ 2003-04-28 17:16 UTC (permalink / raw)
To: Muthukumar R; +Cc: gcc-help
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@iqmail.net]
Sent: Monday, April 28, 2003 12:51 PM
To: Prasanna Katta
Cc: gcc-help@gcc.gnu.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.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-04-28 17:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-28 17:02 Trying to build a shared library on solaris using gcc Prasanna Katta
2003-04-28 17:10 ` Muthukumar R
2003-04-28 17:16 Prasanna Katta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).