Hello,
I am using g++ 3.3 on os X 10.3.9. I have created my own library
using
ar ruv *.o files
After this I try to compile a test program using,
g++ -pg -O -Wno-deprecated -ansi -pedantic -o test test.C
-DANSI_HEADERS -D_G_HAVE_BOOL -I. -I/ALLINCLUDEDIRS -lmylib -llpsolve51
-lm -L.
And the compilation works fine.
But when i try to run the executable ./test, I get the following error
message:
dyld: ./test_grid can't open library: liblpsolve51.dylib (No such file
or directory, errno = 2)
Trace/BPT trap
The library liblpsolve.dylib is NOT located in the current directory. I
tried checking the value of LD_LIBRARY_PATH using echo$LD_LIBRARY_PATH,
but nothing showed up.
It seems that LD_LIBRARY_PATH is not set, and moreover I am not even
sure if it is used on darwin?
How can I resolve this problem?
thanks,
amit.
John Whorfin - 18 Aug 2005 23:54 GMT
> It seems that LD_LIBRARY_PATH is not set, and moreover I am not even
> sure if it is used on darwin?
Darwin uses DYLD_LIBRARY_PATH
> How can I resolve this problem?
Read the dyld man page.
Amit Bhatia - 19 Aug 2005 00:09 GMT
On doing echo $DYLD_LIBRARY_PATH I do not see any paths :( Isn't a
default value set for them already?
thanks,
--a.
> > It seems that LD_LIBRARY_PATH is not set, and moreover I am not even
> > sure if it is used on darwin?
[quoted text clipped - 4 lines]
>
> Read the dyld man page.
Piet van Oostrum - 26 Aug 2005 15:44 GMT
>>>>> "Amit Bhatia" <amit.bhatia@gmail.com> (AB) wrote:
>AB> On doing echo $DYLD_LIBRARY_PATH I do not see any paths :( Isn't a
>AB> default value set for them already?
It looks also in ~/lib /usr/local/lib /lib /usr/lib. But these are not in
$DYLD_LIBRARY_PATH. As you could read in man dyld.

Signature
Piet van Oostrum <piet@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: piet@vanoostrum.org