Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QtOpengl conflict with Opengl framwork on mac
Qt 6.11 is out! See what's new in the release blog

QtOpengl conflict with Opengl framwork on mac

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.6k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    supersuraccoon
    wrote on last edited by
    #1

    I am trying to merge cocos2d-x 3.12 and Qt 5.7 together and was keep getting the conflict error message when linking:

    In file included from Qt5.7.0/5.7/clang_64/lib/QtOpenGL.framework/Headers/QGLWidget:1:
    In file included from Qt5.7.0/5.7/clang_64/lib/QtOpenGL.framework/Headers/qgl.h:45:
    In file included from Qt5.7.0/5.7/clang_64/lib/QtGui.framework/Headers/qopengl.h:124:
    
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl3.h:2704:21: error: conflicting types for 'glDepthRange'
    GLAPI void APIENTRY glDepthRangef (GLclampf n, GLclampf f);
                        ^
    demo/cocos2d-x/cocos/platform/mac/CCGL-mac.h:43:41: note: expanded from macro 'glDepthRangef'
    #define glDepthRangef                   glDepthRange
                                            ^
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl3.h:1662:21: note: previous declaration is here
    GLAPI void APIENTRY glDepthRange (GLclampd near, GLclampd far);
    

    I tried to remove the Opengl Framework in .pro file like this :

    QT       += core gui opengl
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = QtApplication
    TEMPLATE = app
    
    #INCLUDEPATH += /usr/local/include
    #LIBS += -L/usr/local/lib/ -lGLEW
    LIBS += -L/usr/local/lib/ -lz
    LIBS += -L/usr/local/lib/ -lcurl
    
    LIBS    += -framework Cocoa
    LIBS    += -framework Foundation
    LIBS    += -framework OpenAL
    LIBS    += -framework IOKit
    LIBS    += -framework CoreVideo
    LIBS    += -framework OpenGL
    

    But it was not working, still the same error.

    Any advice will be appreciated, thanks :)

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Looks rather like cocos2d-x is doing something funky here. You should comment that line since glDepthRangef is provided by the current OS X SDK.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Looks rather like cocos2d-x is doing something funky here. You should comment that line since glDepthRangef is provided by the current OS X SDK.

        S Offline
        S Offline
        supersuraccoon
        wrote on last edited by
        #3

        @SGaist Thanks for your reply, I commented out the 2 lines in one file and now it compiled and linked fine.

        I am able to run the app now but was having some problems I thought might be related to this modification ?

        I have posted it here, may be you will be have time to have a look:

        https://forum.qt.io/topic/69286/cocos2dx-in-qt-weird-crash-problem

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Good !

          In that case, please mark the thread as solved using the "Topic Tools" button so that other forum members may know a solution has been found :)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved