linking against shared libraries not in default path

Anton Shterenlikht mexas at
Mon Nov 29 13:51:02 UTC 2010

I compiled some numerical libraries under my home
directory, including static and shared libs. The
shared lib is

% ls ./src/

Now I'd like to test shared libraries, so I do 

% gfortran45 -o test01.x test01.o qc6a.o -L./src/ -lslatec
% ./test01.x 
/libexec/ Shared object "" not found, required by "test01.x"

How can I tell the executable to look for a shared library
in a specific directory? I tried setting LIBRARY_PATH, but
it didn't help.

Perhaps I completely misunderstand how shared libraries work..

Please advise

many thanks

Anton Shterenlikht
Room 2.6, Queen's Building
Mech Eng Dept
Bristol University
University Walk, Bristol BS8 1TR, UK
Tel: +44 (0)117 331 5944
Fax: +44 (0)117 929 4423

More information about the freebsd-questions mailing list