1

I installed Qt 5.9 online and then I run an opengl example project named "boxes". It showed error when I built.

:-1: error: This example requires Qt to be configured with -opengl desktop

I tried to fixed it using the answers to the question QT and native OpenGL support in MS Windows, but failed. The site said that "different versions of Qt, for different targets, with or without OpenGL support". I'm using Qt 5.9 and I can't find any options msvc201x xx-bit OpenGL.

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
Aaron Lee
  • 2,060
  • 2
  • 15
  • 20
  • 2
    Possible duplicate of [QT and native OpenGL support in MS Windows](https://stackoverflow.com/questions/26813229/qt-and-native-opengl-support-in-ms-windows) – rbaleksandar Sep 19 '17 at 11:40
  • I'm voting to close this question as off-topic because Qt SDK has rich set of examples related to OpenGL usage. – Michael IV Sep 19 '17 at 13:07
  • And still this is a problem.... If you need to recompile it, come on... 2020... _"'nmake' is not recognized as an internal or external command,"_ something with a path? garbage it is... – Jeroen van Langen Mar 13 '20 at 17:42

2 Answers2

0

This example requires Qt to be configured with -opengl desktop

The question is about configuring Qt and the author likely has Qt which is configured different than the example project requires.

http://doc.qt.io/qt-5/configure-options.html

configure.bat -opengl desktop

Mind that Qt also needs to be built with this option. And you don't necessarily need to build Qt but can get via Qt Maintenance tool etc.

Alexander V
  • 8,351
  • 4
  • 38
  • 47
0

As of Qt 5.5 the pre-built packages are built with the opengl dynamic option as documented here:

Note: As of Qt 5.5 this [-opengl dynamic] is the configuration used by the official, pre-built binary packages of Qt.

Therefore the only option is to build it from source as described by AlexanderVX.

m7913d
  • 10,244
  • 7
  • 28
  • 56