This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Statically linked shared library
- From: Michael Haubenwallner <michael dot haubenwallner at salomon dot at>
- To: Kolesar <asim dot husanovic at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sat, 14 Mar 2009 21:48:28 +0100
- Subject: Re: Statically linked shared library
- References: <22478672.post@talk.nabble.com>
On Thu, 2009-03-12 at 08:39 -0700, Kolesar wrote:
> Hi All
>
> I try linked shared library, statically, but i get error. Where I made
> mistake? Please help.
>
> Exactly, I want dynamically linked -ldl -lrt -luuid -lm -ldl, and statically
> linked -ldrmod (libdrmod.so)
As far as I can tell, statically linking a shared library does not work
for example on Linux, Solaris, HP-UX, Windows.
The only platform I know of being able to do that is AIX.
> g++ -static -ldl -lrt -luuid -lm -ldl -o
> /home/asimh/my_program/src/.bin/sysnfop1s.so
> -L/home/asimh/my_program/lib/.bin -ldrmod
>
> /usr/bin/ld: cannot find -ldrmod
When switched to static linking, the linker does not search for your
libdrmod.so, but libdrmod.a only (even on AIX), which simply does not
exist.
HTH,
/haubi/