Nominate our 2022 Qt Champions!

Trouble building Mac-originated OpenGL project on Windows

  • I have a QtCreator project that uses OpenGL via QGLWidget. The project builds and runs okay on Mac and now I am trying to build the same on windows. I downloaded and installed latest 64-bit Qt and QtCreator on my PC and even though pro file may be open I experience huge headaches trying to build it. A number of GL constants and function declarations are not being seen by the compiler. I guess where needs to be some #defines that would cause inclusion of additional header files. Even if header problems resolved I would probably run into issues with libraries. I wonder if there exists some documentation re what needs to be done. So far my expectations of some lever of Qt-based project portability are not being fulfilled and it feels like I am banging my head against a wall.

    BTW - my OpenGL needs and usage is limited to OpenGL 2.0.

  • Moderators

    You need OpenGL drivers installed on your Windows machine. By default, Windows only provides OpenGL 1.1 software driver.

  • I believe I already have the drivers. Besides how could drivers possibly affect compilation? I am getting errors at compile time.

  • Moderators

    On Windows, driver packages provide OpenGL headers and libraries that are required, afaik.

  • I am confused regarding entire topic of developing OpenGL applications with Qt. To begin with there are 3 different ways how Qt 5.3 may be downloaded for 64 bit Windows and I seem to get different support for OpenGL depending on download. Download Notes state:
    The Windows offline installers are by default ANGLE based. If you want to know more about the differences between ANGLE and OpenGL packages on Windows, please visit "Qt 5 on Windows ANGLE and OpenGL":
    Since I don't need GL features past 2.0 and I don't want my users worry about installing graphics drivers ANGLE seems to be an appropriate choice. Qt makes claims of portable OpenGL support using ANGLE as long as I don't need more recent functions of OpenGL. None of 3 available download versions of Qt 5.3 allow me to compile my application (which uses nothing later than GL 1.5). I don't mind doing more work if necessary, but I'd rather avoid wild-goose chase and making changes that will result in breaking Mac compilation. This is why I look for a document telling me what to do.

    We are tired of futile attempts to find a portable OpenGL setup and my company would go as far as paying a consultant for doing this job for us.

  • Moderators

    Minimal OpenGL version you can use in Qt is 2.0, but I doubt that means that older headers might be missing. I am no expert in OpenGL support in Qt myself. I never had any problems compiling or using recent versions of Qt 5 on Windows.

    As for consultancy: there are lots of options. I know Gunnar (who wrote Qt's Scenegraph) is available for hire right now, plus there are multiple companies that can help you (Milo Solutions, where I work, KDAB, woboq, ICS, Digia/ The Qt Company).

  • Thank for additional pointers. I downloaded offline version of Qt 5.3.2 for Windows 64-bit (VS 2013) (not the one marked as OpenGL). According to downloads page it has to correspond to GL 2.0 and contain ANGLE emulation of OpenGL. When looking at defines in automatically generated VS2013 solution I do see QT_OPENGL_ES_2 and QT_OPENGL_ES_2_ANGLE defined. However when I try to compile I observe that a number of gl methods and constants are known to compiler, but some aren't even such basic methods as glBegin or constant GL_QUADS.

Log in to reply