0

I'm on OS X 10.11, and I have never had problems with linking libraries, but yesterday, out of the blue, I start getting errors when including GSL headers. For instance, I get: "fatal error: 'gsl/gsl_matrix.h' file not found", coming from the line

#include<gsl/gsl_matrix.h>

I then compile with the -lgsl flag, which has worked for the last 6 months, but now suddenly stopped working. GSL is installed through Homebrew, and is located in /usr/local/Cellar/gsl and passing this to the compiler with -I does not help either.

Any idea how this problem could suddenly begin? Brew doctor does not tell me anything useful.

  • Have you installed the command line tools? Have you run `xcode-select` since you last updated XCode, probably to 7.0.1? You say the GSL code is in `/usr/local/Cellar/gsl`; are you adding `-I/usr/local/Cellar/gsl/include` to the command line to find the headers? Are you adding `-L/usr/local/Cellar/gsl/lib` to the command line to find the libraries? El Capitan changed the rules dramatically, and you can't install libraries, or symlinks to libraries, in `/usr/lib` any more. See [Can Mac OS X El Capitan run software compiled for Yosemite that …?](https://stackoverflow.com/questions/33074492/) – Jonathan Leffler Oct 20 '15 at 14:54
  • By providing the full paths of the headers and libraries, I can get it to compile. Interestingly, I got the error 'ld: library not found for -lgmp' until I removed this flag. The GMP library was not being used for anything anyway, it was left over from an earlier version. However, this has never been a problem before. So, it seems something is wrong with the linking of libraries through the -l flag. I am not quite sure what to do with the 'xcode-select' command, but if it compiles then it's probably not an issue? I am reading up on El Capitan right now. I have chowned /usr/local. – jmidtgaard Oct 20 '15 at 16:07

0 Answers0