This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: undefined reference
- From: Achim Gädke <Achim dot Gaedke at physik dot tu-darmstadt dot de>
- To: Cheng Xing <cx101 at ohm dot york dot ac dot uk>
- Cc: gsl-discuss at sources dot redhat dot com
- Date: Mon, 22 Sep 2003 20:53:59 +0200
- Subject: Re: undefined reference
- References: <3F6F42E1.80008@ohm.york.ac.uk>
Cheng Xing wrote:
Well, I input gsl-config --lib, and get
-L/usr/local/lib -lgsl -lgslcblas -lm
So is that ok to compile with 'gcc filename -lgsl -lgslcblas -lm'?
I did compile successfully this time, but got another warning message
when run the file a.out. It said:
a.out: error while loading shared libraries: libgsl.so.0 : cannot open
shared object file: No such file or directory.
But I did find this file in my usr/local/lib
-Cheng
Ok, now add /usr/local/lib to the environment variable LD_LIBRARY_PATH,
for bash it is
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
In order to add the additional library search path to the binary use the
flag while compiling:
-Wl,-rpath=/usr/local/lib
Yours, Achim