C++ libsndfile and mac osx

1.3k views Asked by At

I've seen this question around quite a lot but I'm fairly new to C++ and I've tried following each answer. I am trying to use the libsndfile lib with XCode and mac osx mavericks. However the problem lies with

/* 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

where I get the error 'Unknown type name '__int64' I understand this is due to __int64 being for windows but how can I change this for a mac?

2

There are 2 answers

0
Ryanas On BEST ANSWER

I've found something that works. For anyone who wishes to use the libsndfile library with a mac should look at this:

https://github.com/angeloseme/ofxLibsndfileRecorder

Download the files and dump all of the files within your src folder. Works perfectly. Credit to the author.

0
son of the northern darkness On

I'm not familiar with this library. Are you sure you include the right header file. It seems from the comment that this file is intended to be used with Windows. Anyway...

__int64_t should be defined in some other header. It is typedef for long long. To workaround this you can add typedef long long __int64_t; before you include the header.