Post

Replies

Boosts

Views

Activity

error: no member named 'nullptr_t' in the global namespace
clang++ compilation appears to be completely broken under the latest version of macos Ventura (13.3)/Xcode (14.3)/CommandLineTools/MacOsX.sdk (13.3) This is easy to reproduce. Here's the simplest example I can come up with: Create a file named Test.cpp with the following contents: #include <cstddef> int main() { return 0; } Try to compile it with the following command on a command line in Terminal.app window clang++ -std=c++17 -stdlib=libc++ -g -c -o Test.o Test.cpp This should compile successfully and create the file Test.o, but instead it generates an error that appears to come from bug(s) within the SDK (Entire error response shown below) Error response: In file included from Test.cpp:4: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:52:9: error: no member named 'nullptr_t' in the global namespace using ::nullptr_t; ~~^ 1 error generated. Unfortunately the error seems to occur early in the include chain of many headers. For example if instead of #include <cstddef> you use #include <vector> or #include <list> the number of errors returned increases dramatically. This has had the effect of derailing almost ALL of my C++ compilation on the latest version of Ventura -- a major problem for me, since I (and presumably many others) develop on the mac for a living. There are similar questions already posted on Stack Overflow / Stack Exchange: • https://stackoverflow.com/questions/75921280/updating-to-macos-13-3-broke-compiling-cpp • https://apple.stackexchange.com/questions/458062/unable-to-find-include-file-on-newly-updated-macosc-c/459037 I have also submitted the issue to Apple through the Feedback tool though I'm not sure this link is publicly viewable: • https://feedbackassistant.apple.com/feedback/12156695 A possible hint: Other internet research indicates that this problem may not occur when using Xcode to compile. I do not use Xcode, Visual Studio or any other IDE, so I haven't tested this. (I've always found it much quicker to operate "closer to the metal" with the command line and basic makefiles, so I haven't learned the IDEs.) I'd love it if anyone has any insights into how to fix this bug that has seemingly broken C++ development in the latest macos release. Thanks! Dave Lumieria
14
3
4.2k
Apr ’23