error:: undefined reference to symbol '__glewBufferSubData' 未定义的引用 以及 error: main.o: undefined reference to symbol 'glTexImage2D'

时间:2023-03-10 00:20:51
error:: undefined reference to symbol '__glewBufferSubData'  未定义的引用       以及       error: main.o: undefined reference to symbol 'glTexImage2D'

在把DSO移植到QT工程中,出现了

/usr/bin/ld: KeyFrameDisplay.o: undefined reference to symbol '__glewBufferSubData'

报错,原因是.pro文件中没有加 GLEW库。

解决方案:

在.pro文件中加上这句:

##### GLEW #####
LIBS += -lGLEW

error: main.o: undefined reference to symbol 'glTexImage2D'

报错,原因是.pro文件中没有加OpenGL

解决方案:qt中内置了opengl,因此在.pro文件中加上这句:

QT += opengl