Re: Compiling an objective-c source, I don't know how to resolve the compiler error.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Let's Cc: the ObjC maintainer:


Segher


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()
> 
> GCC Version
> ===========
> 
> gcc-15 (Homebrew GCC 15.1.0) 15.1.0
> Copyright (C) 2025 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> 
> 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
> 
> 
> Error Reported:
> ===============
> 
> In file included from /opt/homebrew/Cellar/gcc/15.1.0/lib/gcc/current/gcc/aarch64-apple-darwin24/15/include-gnu-runtime/objc/Object.h:29,
>                  from synt.m:1:
> /opt/homebrew/Cellar/gcc/15.1.0/lib/gcc/current/gcc/aarch64-apple-darwin24/15/include-gnu-runtime/objc/objc.h:72:37: error: conflicting types for 'SEL'; have 'const struct objc_selector *'
>    72 | typedef const struct objc_selector *SEL;
>       |                                     ^~~
> <built-in>: note: previous declaration of 'SEL' with type 'SEL'
> make: *** [synt.o] Error 1
> 
> Host (uname -a)
> ===============
> 
> Darwin Jean-Marcs-MacBook-Pro.local 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000 arm64
> 



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux