QCustomPlot Discussion and Comments

Undefined reference to... Return to overview

Hey guys, I have a problem. Some minutes before, my project with QCP worked perfect, but now, I get some errors, without changing the code...

./debug\qcustomplot.o: In function `ZN19QCPPaintBufferGlFbo5clearERK6QColor':
C:\..../QCustomPlot/qcustomplot.cpp:909: undefined reference to `_imp__glClearColor@16'
C:\..../QCustomPlot/qcustomplot.cpp:910: undefined reference to `_imp__glClear@4'
collect2.exe: error: ld returned 1 exit status
mingw32-make[1]: *** [debug\graphicviewer.exe] Error 1

Why I get this error without changing anything? Qmake and rebuilding the project didnt help, also downloaded the source-files again and pasted them in the folder, also didnt help....

maybe it's the same problem

Thank you, so I changed the lines 909 and 910 of the qcustomplot.cpp from:

  glClearColor(color.redF(), color.greenF(), color.blueF(), color.alphaF());


mGlContext.data()->functions()->glClearColor(color.redF(), color.greenF(), color.blueF(), color.alphaF());
mGlContext.data()->functions()->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

And it worked again. But also tried it with the first option again and delete the "DEFINES += QCUSTOMPLOT_USE_OPENGL" from my .pro-file, because I forgot to remove it (not necessary for me) and it works normal again.