Search code examples
gcclibsndfile

sndfile.h not found on OS X


I'm trying to install libsndfile on OSX, and I used homebrew (brew install libsndfile). But when I try to compile some example code with #include <sndfile.h> using gcc it says sndfile.h cannot be found, but when I check in /usr/local/include it's right there. Is there something I'm missing?


Solution

  • Depending on which compiler you're using you may need to add:

    -I/usr/local/include 
    

    to you your command line, e.g.

    gcc -Wall -I/usr/local/include foo.c -o foo