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