Xcode Beta 3 compile error

Hello All:

I dusted off some old code to bring up to date with the latest and greatest Xcode (16B3) and ran into this weird compile error. Doesn't appear to be actually in my code. The code is in Objective-C (I did say it was old).

In file included from /Volumes/Hard Disk 2/Codewarrior Projects/iCollect For Mac and iPad/iCollect2/Classes/NSImage+Additions.mm:9:
In file included from /Volumes/Hard Disk 2/Codewarrior Projects/iCollect For Mac and iPad/iCollect2/Classes/NSImage+Additions.h:10:
In file included from /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/Quartz.framework/Headers/Quartz.h:9:
In file included from /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/Quartz.framework/Headers/PDFKit.h:6:
In file included from /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/PDFKit.framework/Headers/PDFKit.h:21:
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/PDFKit.framework/Headers/PDFDocument.h:26:53: error: expected identifier or '{'
   26 | typedef NS_ENUM(NSUInteger, PDFSelectionGranularity);
      |                                                     ^
1 error generated.

Any ideas? I understand that Xcode is in beta now and if this is outside of the forum's scope, no problem. If a radar needs to be opened, I'll do that too if required.

Thanks in advance for your time.

All Best

John

Thanks for sharing your post and the error message. From the detailed error log, it's not clear that the issue has come from the PDFDocument.h file, even though it manifests in another component. This suggests that the problem might be rooted in the class importation of the PDFKit framework.

Specifically, the error message on line 26 of PDFDocument.h points out that it expects an identifier or '{', which hints at a missing brace { probably in one of the following locations:

  1. in your code where you import the PDFKit framework.
  2. in the header file of the component causing the error (NSImage+Additions.h).

Here's the exact line where the error seems to be at: PDFDocument.h:26. But it can be in the nested file.

Please, do post your relevant code snippets, especially where you import PDFKit and include other header files, so that we can take a closer look. This will enable us to identify the exact missing brace and assist you in resolving the issue.

It might also be helpful to double-check that you don't have any cluttered spaces or incorrect syntax in the affected files.

Question: Have you tried with the released version of Xcode?

Hello! We see the same issue in our project and submitted a feedback with steps to reproduce the issue: FB13837541 Best Marc

I'm seeing the same error in beta5.

See screenshot,,,

Hey everyone, we received the following reply from Apple, which solved our issue:

Based on the error you see, we think that your “C Language Dialect” build setting is set to less than C11. Please update it to GNU11 or higher and try again.

In our Build Setting, we changed the following entries:

  1. C Language Dialect to GNU17
  2. C++ Language Dialect to GNU++23
  3. CLANG_CXX_LANGUAGE_STANDARD to GNU++23

Note that not all these changes might be needed in your project.

Hope this helps! Best Marc

Xcode Beta 3 compile error
 
 
Q