windows mingw QT 出现OpenGL链接错误:error: undefined reference to `_imp__glShadeModel@4' 的解决办法


QT  += opengl

这是因为直接调用了OpenGL的函数,需要在pro中增加以下库引用:
win32-g++ {
    LIBS += -lopengl32 -lglu32 -glmf32
}
win32-msvc*{
    LIBS += opengl32.lib glu32.lib glmf32.lib
}


qt建议使用:
QOpenGLFunctions.

出现error: undefined reference to `gluLookAt@72' 这个是缺 -lglu32


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM