CMake c++ build stopped working after Xcode version 16.2

I recently upgraded to macOS 14.7.2, triggering an upgrade to Xcode 16.2 and its command line tools. My open source project builds and runs fine in Xcode. But when I tested the CMake build, it failed looking for standard c++ headers.

I asked on stackoverflow but no solutions so far.

Any thoughts here?

Answered by DTS Engineer in 822307022

The first step here is to confirm that your command-line tools are working in general. See Investigating Third-Party IDE Integration Problems. If they’re not, that’s something I can help you with. If they are, then this is something specific to CMake, which isn’t something I have any expertise in.

Share and Enjoy

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

The first step here is to confirm that your command-line tools are working in general. See Investigating Third-Party IDE Integration Problems. If they’re not, that’s something I can help you with. If they are, then this is something specific to CMake, which isn’t something I have any expertise in.

Share and Enjoy

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

@DTS Engineer : thanks for looking at this. Unfortunately, after working through your article, I essentially confirmed what I said above: “My open source project builds and runs fine in Xcode. But when I tested the CMake build, it failed looking for standard c++ headers.” Specifically:

fatal error: 'iostream' file not found

It is troubling to me that the only change from the beginning of this week — when the cmake build was working — and now — was to install a “point” update to MacOS 14. It looks like that minor update managed to break a widely used open source tool.

But this is only is CMake, right? You can build a simple C++ program by running clang++ directly?

Presuming that, I don’t have a good answer for you. I’ve no direct experience with CMake. Usually I recommend that folks in your situation seek help via their tool’s support channel.

Before doing that, however, I have another quick test for you to run: If you create a new local user (in System Settings > Users & Groups) and log in as that user, do you have the same problem there?

Share and Enjoy

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

CMake c++ build stopped working after Xcode version 16.2
 
 
Q