Typedef redefinition of ULONG between iODBC Framework and CFPluginCOM.h

I've been using the iODBC framework (https://sourceforge.net/projects/iodbc/files/iodbc/3.52.16/iODBC-SDK-3.52.16-macOS11.dmg/download) for some time in a few Xcode Objective-C projects. Older projects work. Recent new projects fail to compile, with the following error:

/Library/Frameworks/iODBC.framework/Headers/sqltypes.h:220:24 Typedef redefinition with different types ('unsigned long' vs 'UInt32' (aka 'unsigned int'))

The definition in question, from iODBC/sqltypes.h, is:

typedef unsigned long ULONG;

The previous definition, from CoreFoundation/CFPluginCOM.h is:

typedef UInt32 ULONG;

Older projects open, compile and run normally in Xcode 15 and earlier. Only new projects created with Xcode 14 or 15 exhibit this behavior.

CoreFondation/CFPluginCOM.h appears to provide non-essential Component Object Model (COM) support for Win32 apps. The definition of ULONG as UInt32 looks odd considering that CFPluginCOM seems to be aimed at 32-bit architecture.

I find no way to mitigate this conflict within the Xcode project. Is there some way to exclude CFPluginCOM.h, which appears non-essential, from my project?

Is there some way to exclude CFPluginCOM.h, which appears non-essential, from my project?

Have you tried defining COREFOUNDATION_CFPLUGINCOM_SEPARATE? It seems like it was specifically added to do exactly what you want. From the <CoreFoundation/CFPlugIn.h> header:

#if !COREFOUNDATION_CFPLUGINCOM_SEPARATE
#include <CoreFoundation/CFPlugInCOM.h>
#endif /* !COREFOUNDATION_CFPLUGINCOM_SEPARATE */

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Typedef redefinition of ULONG between iODBC Framework and CFPluginCOM.h
 
 
Q