Hi, > On 7 Jun 2025, at 18:48, Segher Boessenkool <segher@xxxxxxxxxxxxxxxxxxx> wrote: > > Let's Cc: the ObjC maintainer: thanks > On Sat, Jun 07, 2025 at 12:12:14PM -0400, Jean-Marc Farinas via Gcc-help wrote: >> I cannot compile an objective-c program on macos. The compilation of objc.h file >> produce an error when encountering the SEL declaration. It seems to be already >> buil-in in the compiler thus reporting a type conflict. >> >> >> Source File Content (named synt.m): >> =================================== >> >> #import <Object.h> >> @interface MyObject : Object >> + (id)startSomething; >> @end() #import <objc/Object.h> @interface MyObject : Object + (id)startSomething; @end >> >> Compilation command: >> ==================== >> >> gcc-15 -I/opt/homebrew/Cellar/gcc/15.1.0/lib/gcc/current/gcc/aarch64-apple-darwin24/15/include-gnu-runtime/objc/ -save-temps -c -o synt.o synt.m GCC Objective-c on macOS supports two different runtimes: - the default “NeXT” runtime installed on the OS .. (support incompiete, but usable for many cases) - the GNU runtime. If you want to use “Object”, then you would want the GNU runtime … like this gcc-15 synt.m -fgnu-runtime -c The compiler automatically switches the objc headers depending on which runtime you have selected. Your command line selected the default for macOS (NeXT) but then you pointed to the GNU runtime headers .. hence the conflict. The base object for NeXT is NSObject. HTH, Iain