【问题标题】:Fatal Error Installing libsndfile on OS X Mavericks在 OS X Mavericks 上安装 libsndfile 的致命错误
【发布时间】:2014-01-26 05:48:40
【问题描述】:

我目前正在尝试在运行 os x 10.9.1 的 Mac 上安装 libsndfile。但是,在运行命令“make”后,它会运行一段时间,然后显示以下消息:sndfile-play.c:61:11: fatal error: 'Carbon.h' file not found. 我没有太多运气找到有类似问题的人。从我发现它看起来可能与不支持较新的操作系统版本有关。有谁知道如何解决这个问题?提前致谢!

【问题讨论】:

    标签: c libsndfile


    【解决方案1】:

    以下对我有用(我运行的是 OS X 10.9.1):

    1. 下载源代码
    2. 解压包
    3. $ ./configure
    4. $ 制作
    5. Carbon.h (sndfile-play.c:61:21: 错误:Carbon.h:没有这样的文件或目录)
    6. 使用以下命令在您的机器中搜索 Carbon.h: $ find /Applications/Xcode.app/Contents/Developer/ | grep Carbon.h
    7. 编辑 **programs/**Makefile
    8. 查找 CFLAGS,确保已配置 CFLAGS: 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-字符串 -Wundef -pipe -I/Developer/Headers/FlatCarbon
    9. $ 制作
    10. $ make check(所有测试都应该通过),然后:
    11. $ sudo make install

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

    【讨论】:

    • 如果其他人暂时不清楚...在上面的 CFLAGS 部分(第 8 步),@martinweiss 建议您附加 -I,然后是 find /Applications/Xcode.app/Contents/Developer/ | grep Carbon.h 的输出 - 没有Carbon.hsn-p...即应该是包含Carbon.h的目录
    【解决方案2】:

    我建议你使用 brew 安装它:http://brew.sh/

    安装后只需运行brew install libsndfile

    【讨论】:

      【解决方案3】:

      也只是删除#include 工作正常。

      【讨论】:

        【解决方案4】:

        要以一般方式解决(即不求助于破解 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 并编译行。

        【讨论】:

          【解决方案5】:

          我用这种方法取得了成功(使用 Mac OSX 10.9.2):

          1) 选择终端应用程序。
          2) 确保我在 bash shell 中(方法在 csh 或 tcsh 中失败)。
          3) 响应 bash$ 类型 ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ****** 注意:这会从网络引入 brew。你必须给你的 系统管理员密码*****.
          4) 响应 bash$ 类型 “酿造安装 libsndfile” ****** 注意:这会将 sndfile.h 和其他各种 libsndfile 文件从 网络并将它们安装在 /usr/local 的子目录中。再一次,你会 必须给你的系统管理员密码*****。

          【讨论】:

            猜你喜欢
            • 2014-05-08
            • 1970-01-01
            • 2014-09-14
            • 1970-01-01
            • 2013-11-01
            • 1970-01-01
            • 1970-01-01
            • 2014-11-30
            • 2014-03-05
            相关资源
            最近更新 更多