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. How do I get a subclass of QGLWidget that uses glew compiled under Qt5?
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.3k Views 1 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.
  • P Offline
    P Offline
    Peachboy
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • F Offline
      F Offline
      FreddeB
      wrote on last edited by
      #2

      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

      Regards
      Fredrik

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Peachboy
        wrote on last edited by
        #3

        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

        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