compile error in LargeFileAccess.cpp on Mac OSX

Hubert Figuière hub at figuiere.net
Sun Feb 28 18:32:25 PST 2010


On 10-02-28 1:25 PM, Steven Samuel Cole wrote:
> I am trying to build exempi 2.1.1 on Mac OSX Snow Leopard.
> ./configure or ./autogen.sh work ok and seem to produce the same
> output. However, when I run make, I get this error:

[...]

> CXX -n XXML_Node.o XML_Node.cpp: In function 'void
> DumpNodeList(std::string*, const XML_NodeVector&, int)':
> XML_Node.cpp:218: warning: format '%d' expects type 'int', but
> argument 4 has type 'long unsigned int' CXX -n XLargeFileAccess.o
> LargeFileAccess.cpp: In function 'void* LFA_Open(const char*,
> char)': LargeFileAccess.cpp:48: error: cannot convert 'SInt16*' to
> 'FSIORefNum*' for argument '5' to 'OSErr FSOpenFork(const FSRef*,
> UniCharCount, const UniChar*, SInt8, FSIORefNum*)'
> LargeFileAccess.cpp: In function 'void* LFA_OpenRsrc(const char*,
> char)': LargeFileAccess.cpp:109: error: cannot convert 'SInt16*' to
> 'FSIORefNum*' for argument '5' to 'OSErr FSOpenFork(const FSRef*,
> UniCharCount, const UniChar*, SInt8, FSIORefNum*)' make[2]: ***
> [LargeFileAccess.lo] Error 1 make[1]: *** [all-recursive] Error 1
> make: *** [all-recursive] Error 1
>
> How can I fix this ?

If you read the Mac documentation, and in particular the 64-bits
transition guide, you'll notice that it says the following:

> Many functions that return reference numbers now return a standard
> data type called FSIORefNum, which is defined as a 16-bit value on
> 32-bit architectures and a 32-bit value on 64-bit architectures.

3 possible solutions:
- make use of the posix API instead (just a matter of changing the 
if-defs), that would be the preferred path IMHO
- fix the code to use the right type
- do not compile for 64-bits.

Your call.

Hub


More information about the Exempi-devel mailing list