[Interest] #include <QtPlatformHeaders/QCocoaNativeContext>

Jean-Michaël Celerier jeanmichael.celerier at gmail.com
Fri May 1 11:13:47 CEST 2020


Easiest fix may be to rename the file in which you're including that to .mm
instead of .cpp, then clang will treat it as Objective-C++

Best,
Jean-Michaël

<http://www.jcelerier.name>


On Fri, May 1, 2020 at 2:51 AM Glenn Ramsey <gr at componic.co.nz> wrote:

> Hi,
>
> I'm wanting to get the native OpenGL context on macOS but when including
> <QtPlatformHeaders/QCocoaNativeContext> I get the following error:
>
>
> In file included from
> .../qt-5.12.7/qtbase/include/QtPlatformHeaders/QCocoaNativeContext:1:
> .../qt-5.12.7/qtbase/include/QtPlatformHeaders/qcocoanativecontext.h:1:
> In file included from
>
> .../qt-5.12.7/qtbase/include/QtPlatformHeaders/../../src/platformheaders/nativecontexts/qcocoanativecontext.h:44:
> In file included from
>
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGL.h:8:
> In file included from
>
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKitDefines.h:11:
>
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:492:1:
> error: expected unqualified-id
> @class NSString, Protocol;
>
>
> Looks like it's including Objective-C stuff that the compiler doesn't like.
>
> This is in a Xcode (11.3) project that was created by CMake. How do I make
> this
> work?
>
> Glenn
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200501/f9c1a6b8/attachment.html>


More information about the Interest mailing list