Typedef override error when trying to create Xcode project for release

I can build my project in Xcode (4.2) for debugging without problems, but when I want to build it for release (build for archiving) I get the error: "Typedef overriding with different types (unsigned int vs unsigned long)".

Problem code:

#ifdef _LZMA_UINT32_IS_ULONG 
typedef long Int32; 
typedef unsigned long UInt32; 
#else 
typedef int Int32; 
typedef unsigned int UInt32; <--error on this line
#endif

      

You can see the whole file: http://read.pudn.com/downloads166/sourcecode/zip/758136/C/Types.h__.htm

The previous definition is in MacTypes.h from the CoreServices framework.

I have the same preprocessor macros for Debug and Release and I am using Apple's LLVM 3.0 compiler. The same error occurs when I try to build a project for analysis.

Any idea why this is happening?

+3


source to share


1 answer


In case of getting an error (when compiling 32-bit) you already have the equivalent

typedef unsigned int UInt32; <--error on this line

      

(hence the error). This way you can remove the offending line.



Apparently not everything from your source includes / imports MacTypes.h, so to have it both ways, the surrounding C # ifdefs violation line looks like this:

#ifndef __MACTYPES__
typedef unsigned int UInt32;
#endif

      

Unfortunately, this is not ideal; you must be sure that if MacTypes.h is enabled, this will happen before then. One way to ensure your system is #imports before local #imports.

+7


source







All Articles