Thanks for answer I'm gave up from statically linked ldrmod :) But, now i have new problem :) Before dlopen(), i set LD_LIBRARY_PATH with putenv(), but i get error: dlopen(sysnfop1s.so) error [2]: libdrmod.so: cannot open shared object file: No such file or directory. How i can set library path where is located my library (libdrmod)? BR //Kolesar Michael Haubenwallner wrote: > > 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/ > > > -- View this message in context: http://www.nabble.com/Statically-linked-shared-library-tp22478672p22539583.html Sent from the gcc - Help mailing list archive at Nabble.com.