I have a sample QT application with the following raw OpenGL calls (not with QGLFunctions):
#define GL_GLEXT_PROTOTYPES
#include <QtOpenGL/QtOpenGL>
GLuint positionBuffer = 1;
glDeleteBuffers(1, &positionBuffer);
glClearColor(0, 1, 0, 1);
glClear(GL_COLOR_BUFFER_BIT);
In Windows desktop configuration I get the following linker errors:
error LNK2019: unresolved external symbol _glDeleteBuffers@8 referenced in function "public: void __thi scall OsgViewer::beforeRendering(void)" (?beforeRendering@OsgViewer@@QAEXXZ) [D:\Repos\build\geoviewer\GeoViewer.vcxpro j]
It is noteworthy that glClearColor and glClear are linked successfully. I tried both QMake and CMake with the same result.
My QMake file is:
QT += qml quick opengl
CONFIG += c++11
DEFINES += GL_GLEXT_PROTOTYPES
#see https://stackoverflow.com/questions/31688370/qt-5-5-with-qmake-linker-cannot-resolve-opengl-function-calls
#LIBS += -llibEGLd.lib -llibGLESv2d.lib
LIBS += opengl32.lib glu32.lib
VERSION = 1.0.11
DEFINES += VERSION_STRING=\\\"$$VERSION\\\"
SOURCES += main.cpp \
squircle.cpp
#Icon files are added in the same way as in quickcontrols2\gallery\ sample
RESOURCES += qml.qrc
HEADERS += \
squircle.h
It links fine (to ANGLE) with 'LIBS += -llibEGLd.lib -llibGLESv2d.lib' but with 'LIBS += opengl32.lib glu32.lib' it does not.
My CMake file contains:
find_package(OpenGL)
target_link_libraries(${PROJECT_NAME} ${OPENGL_LIBRARIES})
it finds glu32 and opengl32 and corresponding DLLs exist in C:/Windows/System32, but I have an impression that opengl32.dll supports some old version of OpenGL, because it has glDeleteLists, but does not have glDeleteBuffers:
so if I have old OpenGL libraries, the question is where to get new libraries?
Qt5OpenGL.dll has QGLFunctions::glDeleteBuffers, but does not have raw glDeleteBuffers:
It is interesting that OpenGLES DLL has all the functions: