【问题标题】:C++ libsndfile and mac osxC++ libsndfile 和 mac osx
【发布时间】:2014-01-05 16:03:50
【问题描述】:

我已经多次看到这个问题,但我对 C++ 还是很陌生,我已经尝试过每个答案。我正在尝试将 libsndfile 库与 XCode 和 mac osx 小牛一起使用。然而问题在于

/* The following typedef is system specific and is defined when libsndfile is
 ** compiled. sf_count_t can be one of loff_t (Linux), off_t (*BSD), off64_t
 ** (Solaris), __int64_t (Win32) etc. On windows, we need to allow the same
 ** header file to be compiler by both GCC and the microsoft compiler.
 */

#ifdef _MSCVER
typedef __int64_t       sf_count_t ;
#define SF_COUNT_MAX            0x7fffffffffffffffi64
#else
typedef __int64_t   sf_count_t ;
#define SF_COUNT_MAX            0x7FFFFFFFFFFFFFFFLL
#endif

我在哪里收到错误“未知类型名称'__int64' 我知道这是因为 __int64 用于 Windows,但我如何才能为 mac 更改它?

【问题讨论】:

    标签: c++ macos libsndfile


    【解决方案1】:

    我不熟悉这个库。你确定你包含正确的头文件。从评论看来,该文件旨在与 Windows 一起使用。总之……

    __int64_t 应该在其他一些头文件中定义。它是很长很长的typedef。 要解决此问题,您可以添加 typedef long long __int64_t;在包含标题之前。

    【讨论】:

      【解决方案2】:

      我发现了一些有用的东西。任何希望在 mac 上使用 libsndfile 库的人都应该看看这个:

      https://github.com/angeloseme/ofxLibsndfileRecorder

      下载文件并转储 src 文件夹中的所有文件。完美运行。感谢作者。

      【讨论】:

        猜你喜欢
        • 2012-12-09
        • 1970-01-01
        • 2012-06-05
        • 2012-12-11
        • 1970-01-01
        • 1970-01-01
        • 2011-11-07
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多