I just upgraded to Xcode 16.0 and Sequoia 15.0. I have a large, mostly Objective-C project that’s giving me the following error. Does anybody know how I can track down this error? I’d love to create a sample project to reproduce it, but I have no idea which part of my project is taking the compiler down this path. Other projects build fine.
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/wchar.h:67:10: note: while building module '_wchar' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/wchar.h:67:
#include <_wchar.h>
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/_wchar.h:76:10: note: while building module '__wctype' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/_wchar.h:76:
#include <sys/_types/_mbstate_t.h>
^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "___wctype.h"
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/___wctype.h:83:24: error: use of undeclared identifier '_CTYPE_A'
return (__istype(_wc, _CTYPE_A|_CTYPE_D));
^
There are 100+ lines of similar errors referencing _CTYPE_A, _CTYPE_C, _CTYPE_D, _CTYPE_G, etc.
I’ve tested this on another Mac that’s still running Sonoma. The project compiles on that computer with Xcode 15.4, but gives the same errors with Xcode 16.
UPDATE: This project is for a macOS application (not sure if that matters).
2
Answers
I solved this problem by following these steps:
Allow non-modular Includes In Framework Modules – NO
Change this to "YES"
Then try to run your app again.
The issue with me was that my project included openSSL static libs and among the include headers was a file "ctype.h", that has the same name as the one of the files in macOS SDK /usr/include folder.
So, yeah, it has to do with "search and discovery" phase of the compiler.
I packed openSSL as a framework and added it to the project, solved this mix-up.