我用 -opengl dynamic 编译了 qt5.4。我已经测试过它,回退工作正常。现在我还想用动态opengl qt库编译qt3d。这可能吗?问题是我的建筑以下面的链接问题结束。如果我理解正确,我不应该添加任何 opengl 库......我该如何解决这个问题?
ConvertUTF" -I"....3rdpartyassimpcontribzlib" -I"....3rdpartyassimpcontribirrXML" -I"....3rdpartyassimpcontribunzip" -I"scene_bezier" -I"network" -I"graphicsview" -I"textures" -I"surfaces" -I"api" -I"C:Qt5.4_angle5.4msvc2013includeQtCore5.4.0" -I"C:Qt5.4_angle5.4msvc2013includeQtCore5.4.0QtCore" -I"C:Qt5.4_angle5.4msvc2013includeQtGui5.4.0" -I"C:Qt5.4_angle5.4msvc2013includeQtGui5.4.0QtGui" -I"C:Qt5.4_angle5.4msvc2013include" -I"C:Qt5.4_angle5.4msvc2013includeQtOpenGL" -I"C:Qt5.4_angle5.4msvc2013includeQtWidgets" -I"C:Qt5.4_angle5.4msvc2013includeQtGui" -I"C:Qt5.4_angle5.4msvc2013includeQtANGLE" -I"C:Qt5.4_angle5.4msvc2013includeQtCore" -I"C:Qt5.4_angle5.4msvc2013includeQtNetwork" -I".mocdebug" -I"C:Qt5.4_angle5.4msvc2013mkspecswin32-msvc2013" -Fo.objdebug @C:UserseDSAppDataLocalTempmoc_qgltexture2d_p.obj.1576.138606.jom
moc_qgltexture2d_p.cpp
link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /DLL /SUBSYSTEM:WINDOWS /VERSION:5.30 /MANIFEST:embed /OUT:....libQt53Dd.dll @C:UserseDSAppDataLocalTempQt53Dd.dll.1576.142070.jom
Creating library ....libQt53Dd.lib and object ....libQt53Dd.exp
qglpainter.obj : error LNK2019: unresolved external symbol __imp__glColor4f@16 referenced in function "public: void __thiscall QGLPainter::updateFixedFunction(class QFlags<enum QGLPainter::Update>)" (?updateFixedFunction@QGLPainter@@QAEXV?$QFlags@W4Update@QGLPainter@@@@@Z)
qglpainter.obj : error LNK2019: unresolved external symbol __imp__glColorPointer@16 referenced in function "void __cdecl qt_gl_setVertexAttribute(enum QGL::VertexAttribute,class QGLAttributeValue const &)" (?qt_gl_setVertexAttribute@@YAXW4VertexAttribute@QGL@@ABVQGLAttributeValue@@@Z)
qglpainter.obj : error LNK2019: unresolved external symbol __imp__glLightModelfv@8 referenced in function "public: void __thiscall QGLPainter::updateFixedFunction(class QFlags<enum QGLPainter::Update>)" (?updateFixedFunction@QGLPainter@@QAEXV?
glColor4f
、glColorPointer
和glLightModelfv
都是OpenGL 1.1或更早的函数。
在 Windows 上,OpenGL32.lib
有责任在链接时提供这些内容。Windows上更新于1.1的OpenGL的任何部分都必须在运行时动态加载,如果您使用适当的包装类,Qt实际上会为您执行此操作。
无论如何,若要解决此问题,只需将OpenGL32.lib
添加到链接器依赖项中即可。
提到这个新的Qt功能的文章(我的意思是-opengl dynamic
)说:
想要动态切换的应用程序必须始终使用 QOpenGLFunctions,并准备好在OpenGL和OpenGL上运行 ES 2.0
源
因此,您不能使用已从OpenGL ES 2.0中删除的glColor4f
,glColorPointer
,glLightModelfv
,glBegin
等功能。