[Interest] #include <QtPlatformHeaders/QCocoaNativeContext>

Jean-Michaël Celerier jeanmichael.celerier at gmail.com
Fri May 1 23:53:17 CEST 2020


.m is Objective-C,  you want .mm (Objective-C++) AFAIK

Best,

On Fri, May 1, 2020 at 11:05 PM Glenn Ramsey <gr at componic.co.nz> wrote:

> I created a myfile.m with #include <QtPlatformHeaders/QCocoaNativeContext>
> and
> added that to my project.
>
> Now I get a compilation error: Qt requires C++11 support
>
> Glenn
>
> On 1/05/20 9:13 pm, Jean-Michaël Celerier wrote:
> > 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
> > <mailto: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 <mailto:Interest at qt-project.org>
> >     https://lists.qt-project.org/listinfo/interest
> >
>
> _______________________________________________
> 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/1427462d/attachment.html>


More information about the Interest mailing list