Question

I'm currently trying to install libsndfile on my mac running os x 10.9.1. However, when after running the command 'make' it runs for a while and then displays the following message: sndfile-play.c:61:11: fatal error: 'Carbon.h' file not found. I haven't had much luck finding people with a similar issue. From what I found it looks like it may have to do with newer os versions not being supported. Anyone know how to resolve this issue? Thanks in advance!

Was it helpful?

Solution 2

I suggest you use brew to install it : http://brew.sh/

Once installed simply run brew install libsndfile

OTHER TIPS

The following worked for me (I am running OS X 10.9.1):

  1. Download the source code
  2. Untar the bundle
  3. $ ./configure
  4. $ make
  5. A problem should occur with Carbon.h (sndfile-play.c:61:21: error: Carbon.h: No such file or directory)
  6. Search Carbon.h in your machine using: $ find /Applications/Xcode.app/Contents/Developer/ | grep Carbon.h
  7. Edit **programs/**Makefile
  8. Look for CFLAGS, ensure CFLAGS is configured: CFLAGS =
    -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Carbon.framework/Versions/A/Headers/ -g -O2 -std=gnu99 -Wall -Wextra -Wdeclaration-after-statement -Wpointer-arith -funsigned-char -Wstrict-prototypes -Wmissing-prototypes -Wcast-align -Wcast-qual -Wnested-externs -Wbad-function-cast -Wwrite-strings -Wundef -pipe -I/Developer/Headers/FlatCarbon
  9. $ make
  10. $ make check (All test should pass), then:
  11. $ sudo make install

Source: http://comunidad.udistrital.edu.co/ocala/2013/06/09/building-libsndfile-on-mac-os-x/

Also just removing that #include works fine.

To solve in a general way (i.e. without resorting to hacking the Makefile), do an "export CPPFLAGS='-I/" with the path to your Xcode's header directory containing Carbon.h before running ./configure. Here are the steps, all from a Terminal window:

Look for instances of Carbon.h on your system:

find /Applications/Xcode.app/Contents/Developer/ | grep Carbon.h

Output:

/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/Developer/Headers/FlatCarbon/Carbon.h
/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Carbon.framework/Versions/A/Headers/Carbon.h
/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Carbon.framework/Versions/A/Headers/Carbon.h

Using the first line (because it appears to be the most generic header directory), copy the path without including Carbon.h at the end:

/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Carbon.framework/Versions/A/Headers/

Finally, paste that contents within the export line (being sure to include the apostrophes at both ends of the path) like this:

export CPPFLAGS='-I/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Carbon.framework/Versions/A/Headers/'

Now re-run your ./configure and make lines to compile.

I had success with this method (using Mac OSX 10.9.2):

1) Select the Terminal application.
2) Make sure I'm in the bash shell (method fails in csh or tcsh).
3) In response to bash$ type ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ****** note: this brings brew in from the web. you'll have to give your sysadmin password*****.
4) In response to bash$ type "brew install libsndfile" ****** note: this brings sndfile.h and various other libsndfile files in from the web and installs them in subdirectories of /usr/local . Again, you'll have to give your sysadmin password*****.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top