2 Replies
      Latest reply on Oct 6, 2019 10:36 AM by kdeda
      philipd Level 1 Level 1 (0 points)

        Hi,

         

        After upgrading to Xcode 11 (11A420a) compiling objective-C files fails on a line

         

        #import <Cocoa/Cocoa.h>

         

        with this error:

        While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:

        In file included from <module-includes>:1:

        In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:15:

        In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSActionCell.h:8:

        In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSCell.h:11:

        In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSText.h:8:

        In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSView.h:8:

        In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:10:

        In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h:10:

        /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:267:11: error: non-trivial C types are disallowed in union

                } key;

                  ^

        1 error generated.

         

        what has changed and how to solve it?

         

        thanks

        • Re: Objective-C compilation failure after Xcode 11 update
          eskimo Apple Staff Apple Staff (12,085 points)

          Huh?  All of the paths in that error message are within the 10.11 SDK.  Xcode 11 only ships with, and only supports, the 10.15 SDK.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"

            • Re: Objective-C compilation failure after Xcode 11 update
              kdeda Level 1 Level 1 (0 points)

              Decided to update to Xcode 11.0 (11A420a) this morning ... (i'm on 10.14.6)

              Project builds, runs fine

              IDDAppKit is my framework to share swift/obj-c code

              It has been working so far (it still works)

               

              But the following is printed in the gdb console.

              Strange !!!

              ---

               

              warning: Swift error in scratch context: <module-includes>:1:9: note: in file included from <module-includes>:1:

              #import "Headers/IDDAppKit.h"

                      ^

              error: /Users/kdeda/Development/git.id-design.com/iddappkit/IDDAppKit/IDDAppKit/IDDAppKit.h:13:9: error: 'Cocoa/Cocoa.h' file not found

              #import <Cocoa/Cocoa.h>

                      ^

              /Users/kdeda/Development/git.id-design.com/iddappkit/IDDAppKit/IDDAppKit/IDDAppKit.h:13:9: note: did not find header 'Cocoa.h' in framework 'Cocoa' (loaded from '/System/Library/Frameworks')

              #import <Cocoa/Cocoa.h>

                      ^

              error: could not build Objective-C module 'IDDAppKit'

               

              note: This error message is displayed only once. If the error displayed above is due to conflicting search paths to Clang modules in different images of the debugged executable, this can slow down debugging of Swift code significantly, since a fresh Swift context has to be created every time a conflict is encountered.

               

               

              5591