Statically linked shared library

Axel Freyn axel-freyn@gmx.de
Fri Mar 13 17:21:00 GMT 2009


Hi,
On Thu, Mar 12, 2009 at 08:39:34AM -0700, Kolesar wrote:
> 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)
> 
> 
> 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

g++ treats the last parameter as a filename to work on. You passed as
last parameter "-ldrmod", so g++ believes that's a file in the actual
direcory. As this filename as no extension (like .c, .cc,...), g++ does
not try to compile it but passes the filename to the linker ld - which
creates the error message "cannot find -ldrmod": it does not find a file
named "-ldrmod" in the current working directory...

Axel



More information about the Gcc-help mailing list