• 7482阅读
  • 4回复

qt 如何链接外部静态库 [复制链接]

上一主题 下一主题
离线emugod
 

只看楼主 倒序阅读 楼主  发表于: 2010-04-21
最近想整下MyGUI  结合Ogre 用
直接在Pro文件里
LIBS+=-lOgreMain.dll
调用Ogre库下来没问题.

现在加上 MyGUI ,源码编译出个一个动态库libMyGUIEngine.dll.a和一个静态库libMyGUI.OgrePlatform.a      库链接如下:
LIBS+=-lOgreMain.dll\
-lMyGUIEngine.dll\
-lMyGUI.OgrePlatform
结果错误一大堆,如果只链接动态库编译就没问题,但这静态库是必须的

加了
CONFIG += staticlib
CONFIG += debug_and_release
CONFIG += precompile_header
仍然出错


请问
qt链接外部静态库是不是需要额外的命令?
[ 此帖被emugod在2010-04-21 20:42重新编辑 ]
离线montella099
只看该作者 1楼 发表于: 2010-04-21
-libMyGUI.OgrePlatform
需要-lib么?
直接-lMyGUI.OgrePlatform 呢
离线emugod

只看该作者 2楼 发表于: 2010-04-21
sorry sorry 打错了
是-l不是-lib

不论是msys还是codeblock 编译出来的都是一样的错误
[ 此帖被emugod在2010-04-21 20:47重新编辑 ]
离线benbenmajia

只看该作者 3楼 发表于: 2010-04-22
编译报的什么错....说明白啊
安然.....
离线emugod

只看该作者 4楼 发表于: 2010-04-23
类似于如下错误
e:\Qt\2009.05\qt\lib/libMyGUI.OgrePlatform.a(MyGUI_OgreRenderManager.cpp.obj):d:/Software/ogre/MyGUI_3.0.1_source/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreRenderManager.cpp:261: undefined reference to `Ogre::Matrix4::IDENTITY'
e:\Qt\2009.05\qt\lib/libMyGUI.OgrePlatform.a(MyGUI_OgreRenderManager.cpp.obj):d:/Software/ogre/MyGUI_3.0.1_source/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreRenderManager.cpp:262: undefined reference to `Ogre::Matrix4::IDENTITY'
e:\Qt\2009.05\qt\lib/libMyGUI.OgrePlatform.a(MyGUI_OgreRenderManager.cpp.obj):d:/Software/ogre/MyGUI_3.0.1_source/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreRenderManager.cpp:263: undefined reference to `Ogre::Matrix4::IDENTITY'
e:\Qt\2009.05\qt\lib/libMyGUI.OgrePlatform.a(MyGUI_OgreRenderManager.cpp.obj):d:/Software/ogre/MyGUI_3.0.1_source/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreRenderManager.cpp:270: undefined reference to `Ogre::ColourValue::White'
e:\Qt\2009.05\qt\lib/libMyGUI.OgrePlatform.a(MyGUI_OgreRenderManager.cpp.obj):d:/Software/ogre/MyGUI_3.0.1_source/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreRenderManager.cpp:281: undefined reference to `Ogre::Matrix4::IDENTITY'
e:\Qt\2009.05\qt\lib/libMyGUI.OgrePlatform.a(MyGUI_OgreRenderManager.cpp.obj): In function `GLOBAL__I__ZN5MyGUI17OgreRenderManager10msInstanceE':
d:/Software/ogre/MyGUI_3.0.1_source/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreRenderManager.cpp:366: undefined reference to `__gxx_personality_sj0'
d:/Software/ogre/MyGUI_3.0.1_source/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreRenderManager.cpp:366: undefined reference to `_Unwind_SjLj_Register'
.......
快速回复
限100 字节
 
上一个 下一个