After the Update of Latest Command Line Tools 16.3 I am facing issue to compile C++ programs. Like it is giving some kind of library error in the MACOSX15.sdk file and this is the error.
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/machine/_structs.h:35,
from /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/arm/_mcontext.h:36,
from /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/machine/_mcontext.h:34,
from /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/sys/signal.h:146,
from /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/sys/wait.h:109,
from /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/_stdlib.h:70,
from /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/stdlib.h:58,
from /opt/homebrew/Cellar/gcc/14.2.0_1/include/c++/14/cstdlib:79,
from /opt/homebrew/Cellar/gcc/14.2.0_1/include/c++/14/stdlib.h:36,
from /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/assert.h:44,
from /opt/homebrew/Cellar/gcc/14.2.0_1/include/c++/14/cassert:44,
from /opt/homebrew/Cellar/gcc/14.2.0_1/include/c++/14/aarch64-apple-darwin24/bits/stdc++.h:33,
from 1.cpp:1:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:627:35: error: expected primary-expression before 'unsigned'
627 | } __attribute__((aligned(_Alignof(unsigned int))));
| ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:627:26: error: '_Alignof' was not declared in this scope
627 | } __attribute__((aligned(_Alignof(unsigned int))));
| ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:633:35: error: expected primary-expression before 'unsigned'
633 | } __attribute__((aligned(_Alignof(unsigned int))));
| ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:633:26: error: '_Alignof' was not declared in this scope
633 | } __attribute__((aligned(_Alignof(unsigned int))));
| ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:639:35: error: expected primary-expression before 'unsigned'
639 | } __attribute__((aligned(_Alignof(unsigned int))));
| ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:639:26: error: '_Alignof' was not declared in this scope
639 | } __attribute__((aligned(_Alignof(unsigned int))));
| ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:645:35: error: expected primary-expression before 'unsigned'
645 | } __attribute__((aligned(_Alignof(unsigned int))));
| ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:645:26: error: '_Alignof' was not declared in this scope
645 | } __attribute__((aligned(_Alignof(unsigned int))));
But after downgrading the version to 16.2 it works fine. I can't understand that it's their any issue with Command Line Tools 16.3??
It’s better to reply as a reply, rather than in the comments; see Quinn’s Top Ten DevForums Tips for this and other titbits.
I use gcc for compilation.
Are you using actual GCC? Or the gcc
that’s actually an alias for Clang.
If you’re just using the gcc
command to run Clang, that’s something I can help you with.
OTOH, actual GCC isn’t available from Apple, so it’s not something DTS supports. If you have problems with it, I recommend that you seek help via the support channel for that tool.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"