ld: library not found for -lgsl

Novice C picture Novice C · May 22, 2013 · Viewed 95k times · Source

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 failed with exit code 1 (use -v to see invocation)
make: *** [harm] Error 1

Earlier I found out the I needed to get the gsl library and I used mac ports and typed:

sudo port install gsl

into my command line window and it seemed to isntall okay. Is the missing lgsl not configured correctly or does it not come with gsl? I tried googling lgsl but didn't get much. I've only been at programming a few days and I don't know if I was supposed to set a path, or even really how to do that.

Thanks for any help you guys could offer.

Answer

Mani picture Mani · Nov 18, 2013

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.