macOS 15.1b5, Xcode 16.1b2, does not compile

macOS project, was compiling on macOS 14, now there are errors when trying to compile it again:

In file macOS 15.1 / usr/include/ ___wctype.h there are errors:

Use of undeclared identifier '_CTYPE_A' in line: return (__istype(_wc, _CTYPE_A|_CTYPE_D));

And further down: Use of undeclared identifier '_CTYPE_A' Use of undeclared identifier '_CTYPE_C' Use of undeclared identifier '_CTYPE_D'

Is this an SDK problem?

I'm seeing a similar issue, and I'm also unable to resolve it. The project compiles using Xcode 15.4 on macOS 14.7, but fails to build on Xcode 16.0 & 16.1 on macOS 15.0 with what appears to be a similar set of errors compiling clang module __wctype.

While building module '__wctype': In file included from <module-includes>:1: /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/usr/include/___wctype.h:83:24: error: use of undeclared identifier '_CTYPE_A' 83 | return (__istype(_wc, _CTYPE_A|_CTYPE_D)); | ^ /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/usr/include/___wctype.h:83:33: error: use of undeclared identifier '_CTYPE_D' 83 | return (__istype(_wc, _CTYPE_A|_CTYPE_D)); | ^ /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/usr/include/___wctype.h:89:24: error: use of undeclared identifier '_CTYPE_A' 89 | return (__istype(_wc, _CTYPE_A)); |

....

Experiencing the same on macOS 15.0.1 with Xcode 16.0.

The iOS target does not compile, giving errors related to ___wctype.h:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/___wctype.h:83:24 Use of undeclared identifier '_CTYPE_A' /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/___wctype.h:83:33 Use of undeclared identifier '_CTYPE_D' ... /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/___wctype.h:149:25 Use of undeclared identifier '_CTYPE_X'

Never seen this issue before. Only the iOS target does not compile in the project (regardless whether minimum deployment set to iOS 15 - iOS18). Build settings Base SDK has "iOS" set (without version numbers). The 2 other macOS targets compile in the project. If I create a new empty iOS target, that also compiles, however I can't compile the existing iOS target.

Based on one of the answers above "Xcode 16 appears to have changed the header search behavior." I asked chatGPT: Yes, Xcode 16 has indeed introduced changes in how it handles header search paths, and this might be the root cause of the issues you’re seeing with undeclared identifiers such as _CTYPE_A in headers like ___wctype.h. These changes can affect projects that depend on third-party libraries or custom SDK setups, especially if they modify search paths or include files in a non-standard way.

Go to your project’s Build Settings.

Look for Header Search Paths and ensure they are set up correctly. • You may need to change from recursive to non-recursive to prevent unintended overrides. • Consider moving system paths like /usr/include or /Applications/Xcode.app/Contents/Developer above any custom or third-party paths. • Try adjusting the order of the search paths to ensure that system headers take precedence over any third-party or user-defined paths.

I was able to resolve this under Build Settings by changing a custom path I have set for Header Search Paths, from recursive to non-recursive.

Thanks, this helped a bit. Played with the order/recursiveness and found out a file in the SDK/usr/include has the same name as one header in my openssl include folder.

I need to figure out how to still include the latter file, both in the Header Search Path and in the .h file, but pointing to the correct one?!

OpenSSL 1.1.1d, and probably other versions, has a <ctypes.h> header that is incompatible with Apple's C Standard Library headers. Updating to a newer version of OpenSSL might fix it, or you might try removing the OpenSSL headers from your search paths.

macOS 15.1b5, Xcode 16.1b2, does not compile
 
 
Q