I'm having trouble shared libraries on my Ubuntu 10.04. I expirienced it several times in the last months, read a lot about installing libs but I seem to miss the point.
Starting with the source code directory, I run the following commands:
make
Runs clean, without any errorsudo make install
Seems to be working fine, ends with: cp foo.so.0.1 /usr/local/lib/
rm -f /usr/local/lib/foo.so
ln -s /usr/local/lib/foo.so.0.1 /usr/local/lib/foo.sosudo ldconfig
Runs without any output
When writing a makefile, I can not address the lib by its name, but by its path:
Not working: -lfoo
Working: -L/usr/local/lib/foo.so
The problem stays the same, no matter what lib I try to install.
What am I missing here? Or what can I do to find out?
Is /usr/local/lib/
in your library search path? If not you will need to specify both -lfoo
and /usr/local/lib/
in your Makefile, so the linker knows where to look.
Whether or not /usr/local/lib/
is in your library search path is dependent on your distribution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With