I\'m working in OSX and I\'m attempting to run a make file and when I try I get the following:
ld: library not found for -lgsl
clang: error: linker command f
I just wanted to say that I had the exact problem on OSX. Rather than setting an environment variable, I used an additional compiler flag -L/opt/local/lib
, which then lets one use -lgsl
. I reference this answer.
I got the same issue and here is how I fixed it:
export LIBRARY_PATH=/usr/local/Cellar/gsl/1.16/lib/
I had previously installed gsl using:
brew install gsl
You need to add the path for where the macports installed the gsl library to your LD_LIBRARY_PATH environment variable (or most likely into the build script environment). I believe macports stores things in /opt/local/lib