0

我已经看过很多这个问题,但我对 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更改它?

4

2 回答 2

0

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

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

于 2014-01-05T16:11:27.413 回答
0

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

https://github.com/angeloseme/ofxLibsndfileRecorder

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

于 2014-01-05T22:16:38.870 回答