Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

creating shared libraries

Name: Anonymous 2008-01-10 19:07

every fucking time i've linked my shared library i've had to specify a FULL STATIC PATH NAME in -soname, because if i don't, later i can't link it with my program

if i do this, which should be correct
ld -shared -soname libfoo.so -o libfoo.so libfoo.o
or even ld -shared -Wl,-soname,libfoo.so.1 and all that version crap
one of two things happen when i later link my program against it, the program links fine but doesn't run and ldd says it's linked against libfoo.so (NOT FOUND), OR i can't even link and it cries about libc not finding symbols and shit

anyways, if i instead do this
ld -shared -soname `pwd`/libfoo.so -o libfoo.so libfoo.o

THEN EVERYTHING WORKS, but ldd obviously shows my program linked with /usr/home/bla/bla/bla/full/fucking/static/ass/path/libfoo.so and i don't want that

WHAT THE HELL AM I MISSING /prog/??!?!?!?!?

additional info for tl;dr, of course i compile with -fPIC and all, read the fucking text, EVERYTHING WORKS but the library is linked with a FULL STATIC PATH NAME, that's the only detail that is bothering me, other than that compiling works fine, the program works fine, the library works fine

Name: Anonymous 2008-01-10 19:41

If your shared library is important, significant and useful enough for anybody besides you to give a shit about, someone has already made one better than yours, and it does the same thing and more.

Name: Anonymous 2008-01-10 19:45

NO EXCEPTIONS

Name: Anonymous 2008-01-10 20:01

It needs to be in your library path. Put it in /lib or one of the paths in /etc/ld.so.conf or add your path to that file. Or, use the LD_LIBRARY_PATH environment variable. You might find the LD_DEBUG variable useful too.

Name: Anonymous 2009-03-18 3:16

Don't call me gay, but I need some mary jay!

Marijuana MUST be legalized.

Don't change these.
Name: Email:
Entire Thread Thread List