我用-opengl dynamic编译了qt5.4。我已经对它进行了测试,回退工作正常。现在我还想用动态opengl qt库编译qt3d。这有可能吗?问题是我的构建结束了下面的链接问题。如果我理解正确的话,我不应该添加任何opengl libraries....how,我能解决这个问题吗?
\ConvertUTF" -I"..\..\3rdparty\assimp\contrib\zlib" -I"..\..\3rdparty\assimp\contrib\irrXML" -I"..\..\3rdparty\assimp\contrib\unzip" -I"scene_bezier" -I"network" -I"graphicsview" -I"textures" -I"surfaces" -I"api" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtCore\5.4.0" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtCore\5.4.0\QtCore" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtGui\5.4.0" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtGui\5.4.0\QtGui" -I"C:\Qt\5.4_angle\5.4\msvc2013\include" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtOpenGL" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtWidgets" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtGui" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtANGLE" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtCore" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtNetwork" -I".moc\debug" -I"C:\Qt\5.4_angle\5.4\msvc2013\mkspecs\win32-msvc2013" -Fo.obj\debug\ @C:\Users\eDS\AppData\Local\Temp\moc_qgltexture2d_p.obj.1576.138606.jom
moc_qgltexture2d_p.cpp
link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /DLL /SUBSYSTEM:WINDOWS /VERSION:5.30 /MANIFEST:embed /OUT:..\..\lib\Qt53Dd.dll @C:\Users\eDS\AppData\Local\Temp\Qt53Dd.dll.1576.142070.jom
Creating library ..\..\lib\Qt53Dd.lib and object ..\..\lib\Qt53Dd.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?发布于 2014-12-14 03:31:17
glColor4f、glColorPointer和glLightModelfv都是OpenGL 1.1或更早版本的函数。
在Windows上,OpenGL32.lib有责任在link-time上提供这些。在Windows1.1之后,OpenGL的任何部分都必须在运行时动态加载,如果您使用适当的包装器类,Qt实际上会为您完成这项工作。
无论如何,要解决这个问题,只需将OpenGL32.lib添加到链接器依赖项中即可。
发布于 2014-12-14 04:32:19
提到这个新的Qt特性(我的意思是-opengl dynamic)的文章说:
希望可动态切换的
应用程序必须始终使用QOpenGLFunctions,并准备好同时在OpenGL和OpenGL ES 2.0上运行
source
因此,您不能使用诸如glColor4f、glColorPointer、glLightModelfv、glBegin等已从OpenGL ES 2.0中删除的函数
https://stackoverflow.com/questions/27462631
复制相似问题