码迷,mamicode.com
首页 > 其他好文 > 详细

Ogre1.6.5 编译链接错误之FreeImage

时间:2016-11-19 02:06:09      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:this   call   char   解决方法   class   trait   代码   ima   rem   

这两天想重新学习下ogre,但是在vs2010上编译1.6.5的版本上遇到链接失败的问题,耗了不少时间这里记一下。

主要是一些重定义报错。

>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::operator<<(float)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@M@Z) 已经在 FreeImaged.lib(half.obj) 中定义。

失败环境:

OgreMain是debug版的dll动态库工程,runtime library选的是"多线程调试 DLL (/MDd)"。FreeImage选择的是对应的3.10.0。并且FreeImageLib工程的runtime library也是"多线程调试 DLL (/MDd)"。

按道理来说是不应该出现链接错误的,因为是lib工程和最终需要的dll工程的配置是一样的。

问题和解决方法:

FreeImageLib工程编译出的lib库有问题,不能只把FreeImageLib的runtime library设置为"多线程调试 DLL (/MDd)",需要把它依赖的所有FreeImage工程的Runtime Library都设置为"多线程调试 DLL (/MDd)"。

FreeImage工程如下:

技术分享

runtime配置如下:

技术分享

 另外对应版本的ogre和freeimage源代码可以去sourceforge上搜索。

 

 

Ogre1.6.5 编译链接错误之FreeImage

标签:this   call   char   解决方法   class   trait   代码   ima   rem   

原文地址:http://www.cnblogs.com/beeasy/p/6079162.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!