#import <PDFKit/PDFKit.h> causes a problem

A little lost here so suggestions welcome. Existing code, working well for years. MacOS upgrade (Sequoia) and suddenly issues with

#import <PDFKit/PDFKit.h>

causing the following error message

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/PDFKit.framework/Headers/PDFDocument.h:26:53 Expected identifier or '{'

I recently received a reproducible project through a code-levels support request for this error. This project contained an Objective-C++ (.mm) file that imported PDFKit through the standard syntax #import <PDFKit/PDFKit.h>, and this is the file where the compilation error was cited through the PDFKit import.

Since a C++ compilation pass is required for Objective-C++ files, that prompted me to look at the project build settings, where CLANG_CXX_LANGUAGE_STANDARD was set to Compiler Default, which implies using GNU++98 mode. In a new project created by Xcode 16, the provided value for this setting is currently GNU++20, which is significantly more recent. Switching the value of this setting in the Xcode project showing the compilation error for importing PDFKit from Compiler Default to GNU++20 resolves the compilation error.

—Ed Ford,  DTS Engineer

#import &lt;PDFKit/PDFKit.h&gt; causes a problem
 
 
Q