Qt 5.0.1 and glext.h

  • Hi,

    Newbie here, and evaluating QT with a view to deploying it company-wide for app development, including for ios. I am aware that the ios side of QT is some time off, and willing to wait if QT works well on Windows.

    However, I have :

    #include <GL/gl.h>
    #include <GL/glext.h>
    #include <GL/glu.h>

    with the error message :

    fatal error C1083: Cannot open include file: 'GL/glext.h': No such file or directory

    No combination of also including, or substituting <QtOpenGL>, <QGLFormat>, etc seem to work, instead generating over a hundred errors.

    Any advice would be much appreciated.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You might be missing the "glew":http://glew.sourceforge.net/ library

    Forgot to ask, which version of Qt did you download ?

    As a side note it's Qt, QT stands for Apple's QuickTime :)

  • Hi,

    I stand corrected. Qt it is then.
    What did I download ? Qt 5.0.2 64bit for desktop (MSVC2012)

    Trying to port a 4.8 project on Unix built by my colleague, to my 5.0.2 on windows, and suspect the problem is that he has used legacy opengl.

  • Lifetime Qt Champion

    What could be the most simple is to try Qt 5.1.

    IIRC, there should have been some patches that remove the needs for glew

    Hope it helps

  • Thanks. Well, I'm just evaluating it with a view to a commercial multi-seat licence, so interested if it is a configuration issue or a simple workaround. Having used many other development packages over the years to develop a variety of apps, I am somewhat disappointed with our experience of Qt to date.

    I'm also trying 4.8 on a Mac, so don't get me started there !

    Nevertheless, I'll persevere, who knows, could be a simple fix.

  • Lifetime Qt Champion

    On my side, I've been developing with Qt since the version 3 days without major problems.

    Currently on Windows and OS X with the 4.8.X series and it's going quite well. So if you encounter some problem I might be able to help

  • Thank you for your offer. Seems to be up and running on Mac, after having downloaded multi-Gb to update the OS and update xcode.

    Qt Demo examples compile and run, but a ported project is failing to find GL/gl.h, GL/glext.h, etc.

  • Lifetime Qt Champion

    Do you have QT += opengl in your pro file ?

  • Yes, most certainly

  • Lifetime Qt Champion

    Is it a simple project ? (Meaning one pro file for all)

    If not check that every other project that uses these class also includes opengl

  • It is one pro file only.

    I now notice that, if I try #include <QtOpenGL>, I get "library not found for -IGLU", if that helps.

  • Lifetime Qt Champion

    I think I found out the first problem (must be sleepy to have been so long...):

    on mac you have to:

    @#include <OpenGL/gl.h>@

    That is: framework_name/filename.h

    You can surround that with

    @#ifdef Q_OS_MACX
    #include <OpenGL/gl.h>
    #include <GL/gl.h>

  • Thank you. That seems to have fixed it.

    Now builds with no errors.

    The app runs perfectly. Brilliant. You've made my day.

  • Lifetime Qt Champion

    You're welcome !

    Don't forget to update your thread's title to solved so other forum users may know that a solution has been found :)

  • well, the original QT 5 on Windows and glext.h problem isn't solved....

  • Lifetime Qt Champion

    IIRC, there's no glext.h by default on windows. But you can get the file "here":http://www.opengl.org/registry/

  • Got the file thanks. Throwing up an error, but that may be down to internal programming, so will look into that and report back.....

  • Seems that trying to use glext.h throws up dozens of errors, and it's simply too much of a pain to sort this. I have to conclude that legacy opengl cannot be used with Qt 5.
    Tried reverting to Qt Creator 2.7.1 and Qt 4.8.4 on Windows, but this just refuses to configure a project, and ignores anything set up in the kit options.
    Qt 4.8 seems to be fine on Mac and a unix box, but Qt 5 has too many problems for us to think about using it as a future ipad app tool. If it has too many problems on Windows, it gives us no confidence that it will be safe for ios development.

  • Lifetime Qt Champion

    There must be a glitch in QtCreator's configuration.
    4.8.4 works pretty well on windows (even custom builds)

    Depending on your problem, you might consider contacting Digia to sort things out

Log in to reply