How do I get a subclass of QGLWidget that uses glew compiled under Qt5?



  • Hi everyone,
    I have posted this on stackoverflow, but I guess since it's specific to Qt 5.0.1 I'd repost here.
    Any help would be greatly appreciated,
    Moritz


    I'm struggling to get a subclass of QGLWidget compiled that uses glew. I'm running Qt 5.0.1 + MinGW 4.7 on Windows 7. Glew 1.7.0 has been compiled with said MinGW.
    I have subclassed QGLWidget with UGGLWidget and included "GL/glew.h" before the QGLWidget includes. When compiling I get 200 Errors about:

    • 'function' redeclared as different kind of symbol
    • conflicting declaration 'typedef'

    So my Question:
    How do I get a subclass of QGLWidget that uses glew compiled under Qt5?

    Further details at "my original post":http://stackoverflow.com/q/14803658/1387061



  • Hello !

    I havn't used glew with Qt but I know that there are a patch for Qt5.1 that will make it easier to use OpenGL extensions with Qt. It is written by Sean Harmer at KDAB. It's not GLEW but anyway .. Please look at ..

    http://qt-project.org/wiki/How_to_use_OpenGL_Core_Profile_with_Qt
    https://codereview.qt-project.org/#change,35408

    I hope this helps You ..

    Regards
    Fredrik



  • Thanks Fredrik for the pointers.

    I figured out the problem. Could have done that much faster if I read the compiler errors properly ^^

    When using the provided Qt5SDK for windows I have to add:
    @#define QT_NO_OPENGL_ES_2@

    before each include of QGLWidget.

    Another option would be to rebuild the libraries and use "-opengl desktop" when configuring. "original":http://qt-project.org/forums/viewthread/23459

    Basically the GLES2 includes do not get along with glew.h.

    Have a good day,
    ~Moritz


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.