查看: 6657|回复: 15

Osgbullet编译问题

[复制链接]

该用户从未签到

发表于 2011-3-23 10:12:14 | 显示全部楼层 |阅读模式
编译osgbullet时出现了下面的问题,请编译过osgbullet的大侠点拨点拨,多谢了

1>   正在创建库 D:\osgBullet_01_01_00\bin\Debug\osgbBulletd.lib 和对象 D:\osgBullet_01_01_00\bin\Debug\osgbBulletd.exp
1>CollisionShapes.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall btCollisionShape::getBoundingSphere(class btVector3 &,double &)const " (?getBoundingSphere@btCollisionShape@@UBEXAAVbtVector3@@AAN@Z)
1>CollisionShapes.obj : error LNK2001: 无法解析的外部符号 "public: virtual double __thiscall btCollisionShape::getAngularMotionDisc(void)const " (?getAngularMotionDisc@btCollisionShape@@UBENXZ)
1>CollisionShapes.obj : error LNK2001: 无法解析的外部符号 "public: virtual double __thiscall btCollisionShape::getContactBreakingThreshold(double)const " (?getContactBreakingThreshold@btCollisionShape@@UBENN@Z)
1>CollisionShapes.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall btSphereShape::calculateLocalInertia(double,class btVector3 &)const " (?calculateLocalInertia@btSphereShape@@UBEXNAAVbtVector3@@@Z)
1>CollisionShapes.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall btBoxShape::calculateLocalInertia(double,class btVector3 &)const " (?calculateLocalInertia@btBoxShape@@UBEXNAAVbtVector3@@@Z)
1>CollisionShapes.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall btConvexHullShape::btConvexHullShape(double const *,int,int)" (??0btConvexHullShape@@QAE@PBNHH@Z),该符号在函数 "class btConvexHullShape * __cdecl osgbBullet::btConvexHullCollisionShapeFromOSG(class osg::Node *)" (?btConvexHullCollisionShapeFromOSG@osgbBullet@@YAPAVbtConvexHullShape@@PAVNode@osg@@@Z) 中被引用
1>CollisionShapes.obj : error LNK2019: 无法解析的外部符号 "public: bool __thiscall btShapeHull::buildHull(double)" (?buildHull@btShapeHull@@QAE_NN@Z),该符号在函数 "class osg::Node * __cdecl osgbBullet:sgNodeFromBtCollisionShape(class btConvexHullShape const *,class btTransform const &)" (?osgNodeFromBtCollisionShape@osgbBullet@@YAPAVNode@osg@@PBVbtConvexHullShape@@ABVbtTransform@@@Z) 中被引用
1>CollisionShapes.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall btStaticPlaneShape::btStaticPlaneShape(class btVector3 const &,double)" (??0btStaticPlaneShape@@QAE@ABVbtVector3@@N@Z),该符号在函数 "class osg::Node * __cdecl osgbBullet::generateGroundPlane(class osg::Vec4f const &,class btDynamicsWorld *,class btRigidBody * *)" (?generateGroundPlane@osgbBullet@@YAPAVNode@osg@@ABVVec4f@3@PAVbtDynamicsWorld@@PAPAVbtRigidBody@@@Z) 中被引用
1>MotionState.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall osgwTools::AbsoluteModelTransform::setMatrix(class osg::Matrixd const &)" (__imp_?setMatrix@AbsoluteModelTransform@osgwTools@@QAEXABVMatrixd@osg@@@Z),该符号在函数 "public: void __thiscall osgbBullet::MotionState::setWorldTransformInternal(class btTransform const &)" (?setWorldTransformInternal@MotionState@osgbBullet@@QAEXABVbtTransform@@@Z) 中被引用
1>hysicsState.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __thiscall osgwTools::RefID::str(void)const " (__imp_?str@RefID@osgwTools@@QBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ),该符号在函数 "public: void __thiscall osgbBullet:hysicsState::addPhysicsData(class osgwTools::RefID const *,class osgbBullet::PhysicsData *)" (?addPhysicsData@PhysicsState@osgbBullet@@QAEXPBVRefID@osgwTools@@PAVPhysicsData@2@@Z) 中被引用
1>D:\osgBullet_01_01_00\bin\Debug\osgbBulletd.dll : fatal error LNK1120: 10 个无法解析的外部命令
1>生成日志保存在“file://d:\osgBullet_01_01_00\src\osgbBullet\osgbBullet.dir\Debug\BuildLog.htm”
1>Lib osgbBullet - 11 个错误,11 个警告

该用户从未签到

发表于 2011-3-23 12:42:16 | 显示全部楼层
您的Bullet依赖库设置有问题

该用户从未签到

 楼主| 发表于 2011-3-23 14:16:54 | 显示全部楼层
回复 2# array


    需要的依赖项好像也添加进去了,会不会是别的什么地方的问题?

该用户从未签到

发表于 2011-3-23 14:26:27 | 显示全部楼层
应该不会,就是你的lib文件设置的问题

该用户从未签到

 楼主| 发表于 2011-3-23 14:33:31 | 显示全部楼层
回复 4# liuzhiyu123


    好吧,我在仔细的瞧瞧,但愿是真个地方出了问题,多谢你了啊!!

该用户从未签到

发表于 2011-3-23 14:35:07 | 显示全部楼层
可能是你的文件选择的层次不对,进入的里面的子文件夹,这样他也是找不到的

该用户从未签到

 楼主| 发表于 2011-3-23 14:58:40 | 显示全部楼层
回复 6# liuzhiyu123


    1>   正在创建库 D:\osgBullet_01_01_00\bin\Debug\osgbBulletd.lib 和对象 D:\osgBullet_01_01_00\bin\Debug\osgbBulletd.exp
1>CollisionShapes.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall btCollisionShape::getBoundingSphere(class btVector3 &,double &)const " (?getBoundingSphere@btCollisionShape@@UBEXAAVbtVector3@@AAN@Z)
1>CollisionShapes.obj : error LNK2001: 无法解析的外部符号 "public: virtual double __thiscall btCollisionShape::getAngularMotionDisc(void)const " (?getAngularMotionDisc@btCollisionShape@@UBENXZ)
1>CollisionShapes.obj : error LNK2001: 无法解析的外部符号 "public: virtual double __thiscall btCollisionShape::getContactBreakingThreshold(double)const " (?getContactBreakingThreshold@btCollisionShape@@UBENN@Z)
1>CollisionShapes.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall btSphereShape::calculateLocalInertia(double,class btVector3 &)const " (?calculateLocalInertia@btSphereShape@@UBEXNAAVbtVector3@@@Z)
1>CollisionShapes.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall btBoxShape::calculateLocalInertia(double,class btVector3 &)const " (?calculateLocalInertia@btBoxShape@@UBEXNAAVbtVector3@@@Z)
1>CollisionShapes.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall btConvexHullShape::btConvexHullShape(double const *,int,int)" (??0btConvexHullShape@@QAE@PBNHH@Z),该符号在函数 "class btConvexHullShape * __cdecl osgbBullet::btConvexHullCollisionShapeFromOSG(class osg::Node *)" (?btConvexHullCollisionShapeFromOSG@osgbBullet@@YAPAVbtConvexHullShape@@PAVNode@osg@@@Z) 中被引用
1>CollisionShapes.obj : error LNK2019: 无法解析的外部符号 "public: bool __thiscall btShapeHull::buildHull(double)" (?buildHull@btShapeHull@@QAE_NN@Z),该符号在函数 "class osg::Node * __cdecl osgbBullet:sgNodeFromBtCollisionShape(class btConvexHullShape const *,class btTransform const &)" (?osgNodeFromBtCollisionShape@osgbBullet@@YAPAVNode@osg@@PBVbtConvexHullShape@@ABVbtTransform@@@Z) 中被引用
1>CollisionShapes.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall btStaticPlaneShape::btStaticPlaneShape(class btVector3 const &,double)" (??0btStaticPlaneShape@@QAE@ABVbtVector3@@N@Z),该符号在函数 "class osg::Node * __cdecl osgbBullet::generateGroundPlane(class osg::Vec4f const &,class btDynamicsWorld *,class btRigidBody * *)" (?generateGroundPlane@osgbBullet@@YAPAVNode@osg@@ABVVec4f@3@PAVbtDynamicsWorld@@PAPAVbtRigidBody@@@Z) 中被引用
1>D:\osgBullet_01_01_00\bin\Debug\osgbBulletd.dll : fatal error LNK1120: 8 个无法解析的外部命令
这个库好像就是BulletCollision.lib把,我也加上了,就是上面的这些函数还是没有找到
Bullet好像生成的是静态库把,没有看到dll文件,是不是这个方面的缘故啊,已经编译了好几次,每次都是这个地方有错误,过不去啊!,请您在指教一下。

该用户从未签到

发表于 2011-3-23 15:15:54 | 显示全部楼层
是你添加了,但是还得在附加目录库上设置吧,你看看这个网站,ODE的设置,应该和BUllet一样的,你参照一下http://blog.csdn.net/butterflydog/archive/2010/10/10/5931755.aspx

该用户从未签到

发表于 2011-3-24 08:26:45 | 显示全部楼层
您在编译Bullet的时候是否选中了USE_DOUBLE_PRECISION,我印象中osgbullet是不支持double精度的Bullet库的,会出现链接错误

该用户从未签到

 楼主| 发表于 2011-3-27 11:39:48 | 显示全部楼层
回复 9# array
多谢Array,今天早上重新试了一下,特别注意了这个地方,竟然全部编译成功了,多谢多谢了

该用户从未签到

发表于 2011-4-23 21:57:52 | 显示全部楼层
回复 10# mijue

请问您是怎么编译的,把cmakelist.txt直接拖进去点configure吗,求指教。

该用户从未签到

发表于 2011-6-29 11:11:53 | 显示全部楼层
您好,我也遇到了和您一样的问题,链接错误,我的osgBullet,bullet和osgWorks都是刚从官网上下的最新版。cmake如图[img] 11.JPG [/img],请问问题出在哪里呢?多谢了!

该用户从未签到

发表于 2011-6-30 11:10:33 | 显示全部楼层
这多半是您的bullet库编译的有问题

该用户从未签到

发表于 2011-6-30 14:48:11 | 显示全部楼层
非常感谢Array老师的解答。我的问题出在没有先分别将bullet和osgworks生成出来,直接用osgbullet中的cmake生成了。
现总结如下,希望对需要的人有所帮助:

一、下载源文件
osgBullet编译需要用到下列库:
1.osgBullet (osgBullet_01_01_00.zip) http://code.google.com/p/osgbullet/downloads/list
2.osgWorks  (osgWorks_01_01_00.zip) http://code.google.com/p/osgworks/downloads/list
3.Bullet  (bullet-2.78.zip)             http://code.google.com/p/bullet/downloads/list
二、如果用vs2005,会有如下错误
VC 2005 编译错误:fatal error C1083: 无法打开包括文件:“pmmintrin.h”: No such file or directory

解决方法:

这是由于VC 2005中没有pmmintrin.h这个文件,可以从VC 2008中找到这个文件,再复制到工程目录中,或者复制到VC 2005的头文件目录中。

三、

用cmake先将Bullet和osgWorks分别生成工程,然后分别编译,编译好后,将生成好的lib分别放在各自文件夹下的lib文件夹里。

最后,用cmake生成osgbullet的工程,编译,通过!cmake设置跟我上面发的相同

该用户从未签到

发表于 2013-1-22 20:50:33 | 显示全部楼层
hgyzj 发表于 2011-6-30 14:48
非常感谢Array老师的解答。我的问题出在没有先分别将bullet和osgworks生成出来,直接用osgbullet中的cmake生 ...

你好!能不能告诉我你的联系方式,我也想用这个,可是不知道该怎么配置和编译

该用户从未签到

发表于 2013-4-6 14:59:16 | 显示全部楼层
bullet2.76以上的版本会移除colladaconverter,最好用bullet 2.75或者2.74版本。。。。。。

osgbullet match图

osgbullet match图
您需要登录后才可以回帖 登录 | 注册

本版积分规则

OSG中国官方论坛-有您OSG在中国才更好

网站简介:osgChina是国内首个三维相关技术开源社区,旨在为国内更多的技术开发人员提供最前沿的技术资讯,为更多的三维从业者提供一个学习、交流的技术平台。

联系我们

  • 工作时间:09:00--18:00
  • 反馈邮箱:1315785073@qq.com
快速回复 返回顶部 返回列表