-2

I have downloaded Earth10 from GitHub and when i compile it in Qt5.3_MinGW with QGLWidget then it works but when i compile it in Qt5.5_MinGW with QOpenGLWidget then it pop up "undefined reference to `_imp__glPolygonMode@8'" etc errors. What can i change in source code to get rid of such errors? Or if someone can point me to port from QGLWidget to QOpenGLWidget that would also be helpful.

One quick hack for removing all errors was:

enter image description here

CONFIG += c++11
LIBS   += -lopengl32
LIBS   += -lglu32
LIBS   += -lglut32
Shuji
  • 624
  • 1
  • 8
  • 24

2 Answers2

3

Add opengl32.lib to the libraries linked by the linker stage.

Paraboloid87 showed the exact code which is required to add opengl32.lib:

Add LIBS += -lopengl32 to your *.pro file.

Community
  • 1
  • 1
datenwolf
  • 159,371
  • 13
  • 185
  • 298
1

Thanks for the tip. I'm just "starting" my Qt OpenGL programming experience with QOpenGLWidgets and a call to change the points sizes : calling glPointSize(GLFloat size) caused an undefined reference.

By adding:

CONFIG += c++11
LIBS   += -lopengl32
LIBS   += -lglu32
LIBS   += -lglut32 

in the .pro file, the program went thru building and executed in debug mode...showing the vertex points + the colored triangle. Time for more learning....

Again, thanks for the tip.

James Lim
  • 12,915
  • 4
  • 40
  • 65
Everest
  • 11
  • 2