views:

298

answers:

2

I'm sitting on an OpenSuse 11.1 x64 Box and I have a module that uses sigc++. When linking like this:

g++ [a lot of o's, L's and l's] -lsigc-2.0

I get

/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: cannot find -lsigc-2.0

However the library is there.
In the filesystem:

$ sudo find / -name "libsigc-2.0*"
/usr/lib64/libsigc-2.0.so.0.0.0
/usr/lib64/libsigc-2.0.so.0
/usr/lib64/libsigc-2.0.so

In ld.so.conf I have:

/usr/lib64

And when invoking ldconfig:

$ ldconfig -v | grep sigc
libsigc-2.0.so.0 -> libsigc-2.0.so.0.0.0

Why?

A: 

It is possible that libsigc-2.0.so was linked with an SONAME other than libsigc-2.0.

objdump -p /usr/lib64/libsigc-2.0.so | grep SONAME

If you see something unexpected, e.g. libsigc, you may need to create an additional symlink with that name.

David Joyner
It gives me SONAME libsigc-2.0.so.0and that is what ldconfig takes to set the link to libsigc-2.0.so.0.0.0
GeeF
+1  A: 

I'm so dumb. It's an old codebase and just before the -lsigc-2.0 statement I had a

-Wl,-Bstatic

Obviously, there are no static librarys for libsigc (anymore).

GeeF