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!
5 回答
以下对我有用(我正在运行 OS X 10.9.1):
- 下载源代码
- 解压包
- $ ./配置
- $ 制作
- Carbon.h 应该出现问题(sndfile-play.c:61:21: error: Carbon.h: No such file or directory)
- 使用以下命令在您的机器中搜索 Carbon.h: $ find /Applications/Xcode.app/Contents/Developer/ | grep Carbon.h
- 编辑 **programs/**Makefile
- 查找 CFLAGS,确保已配置 CFLAGS:CFLAGS =
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Carbon.framework/版本/A/标题/ -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 - $ 制作
- $ make check(所有测试都应该通过),然后:
- $ sudo 安装
资料来源:http ://comunidad.udistrital.edu.co/ocala/2013/06/09/building-libsndfile-on-mac-os-x/
我建议你使用 brew 来安装它:http ://brew.sh/
安装后只需运行brew install libsndfile
也只是删除#include 工作正常。
要以一般方式解决(即不求助于破解 Makefile),请在运行 ./configure 之前使用包含 Carbon.h 的 Xcode 头目录的路径执行“export CPPFLAGS='-I/”。以下是所有步骤,均来自终端窗口:
在您的系统上查找 Carbon.h 的实例:
find /Applications/Xcode.app/Contents/Developer/ | grep Carbon.h
输出:
/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
使用第一行(因为它似乎是最通用的头目录),复制路径,最后不包括 Carbon.h:
/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Carbon.framework/Versions/A/Headers/
最后,将该内容粘贴到导出行中(确保在路径的两端包含撇号),如下所示:
export CPPFLAGS='-I/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Carbon.framework/Versions/A/Headers/'
现在重新运行您的 ./configure 并编译行。
我用这种方法取得了成功(使用 Mac OSX 10.9.2):
1) 选择终端应用程序。
2) 确保我在 bash shell 中(方法在 csh 或 tcsh 中失败)。
3)响应 bash$ type ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install )" ****** 注意:这带来了 brew 从网。您必须提供系统管理员密码 *****。
4) 响应 bash$ type "brew install libsndfile" ****** 注意:这会将 sndfile.h 和其他各种 libsndfile 文件从网络中引入,并将它们安装在 /usr/local 的子目录中。同样,您必须提供系统管理员密码 *****。