[MacPorts] #71548: gtk-osx-application-gtk2 build error: cannot find protocol declaration for 'NSString'

MacPorts noreply at macports.org
Fri Dec 20 10:06:49 UTC 2024


#71548: gtk-osx-application-gtk2 build error: cannot find protocol declaration for
'NSString'
---------------------------------------+----------------------
  Reporter:  barracuda156              |      Owner:  mascguy
      Type:  defect                    |     Status:  assigned
  Priority:  Normal                    |  Milestone:
 Component:  ports                     |    Version:  2.10.5
Resolution:                            |   Keywords:
      Port:  gtk-osx-application-gtk2  |
---------------------------------------+----------------------

Comment (by rmottola):

 I was opening a separate bug... but at thend, the issue is the same as
 here.
 At a first guess, I think we have a compiler selection issue. It needs to
 be new enough, gcc 4.2 surely doesn't cut it on 10.5, but I wonder why
 even clang 11 doesn't.

 Also gcc14 doesn't get it:


 {{{
 GtkApplicationDelegate.c:76:83: error: expected '>' before '*' token
    76 | -(void) application: (NSApplication*)theApplication openFiless:
 (NSArray<NSString *> *) files
       |
 ^
 GtkApplicationDelegate.c:76:1: error: cannot find protocol declaration for
 'NSString'
    76 | -(void) application: (NSApplication*)theApplication openFiless:
 (NSArray<NSString *> *) files
       | ^
 make[2]: **
 }}}


 So even if it is a clang only feature it doesn't work.

 Apparently, from a bit of research, these are "Lightweight Generics" and
 introduced with XCode 7, so about MacOS 10.10. Maybe public clang doesn't
 cut it, maybe  they need SDK support which we won't have on 10.5 and 10.6.
 Anyway, they are only some aid to generate warnings, at the end.

 I made a trivial patch which fixes build.

-- 
Ticket URL: <https://trac.macports.org/ticket/71548#comment:7>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list