Bullet物理引擎静态库安装问题

发布于 2024-11-18 02:26:30 字数 4186 浏览 3 评论 0原文

嘿,所以我刚刚下载了bullet 2.78,并执行了以下步骤:

  • 解压缩并找到了这个教程

  • 完全按照 Cmake 的步骤进行操作,除了我发现教程中的图片检查了一些内容,例如安装库,但我没有,所以我最终检查了所有可能的内容。

  • 进入新生成的BULLET_PHYSICS.vcxproj并在调试和发布下构建它

  • 看到我在lib 文件夹位于 msvn/BulletBuild/lib 中,但对它们没有执行任何操作

  • 完全按照教程中的其余步骤来设置实际项目

  • 尝试构建最后一行代码:失败

  • 想知道我是否需要 dll,因为 lib 文件夹中只显示 .libs 和 pdbs,并且教程没有提到em

我的重建库的唯一经验是通过 SFML 构建下载中包含的 msvn 文件并使用生成的动态 lib 和 dll 文件。然而,教程中的说明非常不同。 (如果有人能向我解释这是如何工作的,那就太好了)

我多次严格按照说明操作,但我不确定我错过了什么。如果我注释掉 main 中的代码行但保留包含,则构建有效,但是当我保留它时,我得到以下信息:

    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "void * __cdecl btAlignedAllocInternal(unsigned int,int)" (?btAlignedAllocInternal@@YAPAXIH@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "void __cdecl btAlignedFreeInternal(void *)" (?btAlignedFreeInternal@@YAXPAX@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btConvexInternalShape::getAabbSlow(class btTransform const &,class btVector3 &,class btVector3 &)const " (?getAabbSlow@btConvexInternalShape@@UBEXABVbtTransform@@AAVbtVector3@@1@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual char const * __thiscall btCollisionShape::serialize(void *,class btSerializer *)const " (?serialize@btCollisionShape@@UBEPBDPAXPAVbtSerializer@@@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: __thiscall btPolyhedralConvexShape::btPolyhedralConvexShape(void)" (??0btPolyhedralConvexShape@@QAE@XZ)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall btPolyhedralConvexShape::~btPolyhedralConvexShape(void)" (??1btPolyhedralConvexShape@@UAE@XZ)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btConvexInternalShape::setLocalScaling(class btVector3 const &)" (?setLocalScaling@btConvexInternalShape@@UAEXABVbtVector3@@@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btCollisionShape::getBoundingSphere(class btVector3 &,float &)const " (?getBoundingSphere@btCollisionShape@@UBEXAAVbtVector3@@AAM@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getAngularMotionDisc(void)const " (?getAngularMotionDisc@btCollisionShape@@UBEMXZ)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getContactBreakingThreshold(float)const " (?getContactBreakingThreshold@btCollisionShape@@UBEMM@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btCollisionShape::serializeSingleShape(class btSerializer *)const " (?serializeSingleShape@btCollisionShape@@UBEXPAVbtSerializer@@@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btBoxShape::getAabb(class btTransform const &,class btVector3 &,class btVector3 &)const " (?getAabb@btBoxShape@@UBEXABVbtTransform@@AAVbtVector3@@1@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btBoxShape::calculateLocalInertia(float,class btVector3 &)const " (?calculateLocalInertia@btBoxShape@@UBEXMAAVbtVector3@@@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall btPolyhedralConvexShape::initializePolyhedralFeatures(void)" (?initializePolyhedralFeatures@btPolyhedralConvexShape@@UAE_NXZ)
    1>C:\Libraries and Headers\Bullet\bullet-2.78\msvc\BulletTestApp\Release\BulletTestApp.exe : fatal error LNK1120: 14 unresolved externals

我知道某处存在链接问题,但我完全按照说明进行操作,所以我不知道如何修复它。在查看添加项目的属性时,我没有看到任何额外的依赖项,如果这不是它应该的样子... 但我想我一开始就不理解这种使用库的方法这样知识会有帮助。

hey so i just downloaded bullet 2.78, and took the following steps:

  • unziped and found this tutorial

  • followed the steps exactly for Cmake, except i found the pictures in the tutorial had some things checked like INSTALL LIBS and i didn't so I ended up checking EVERYTHING possible.

  • Went into the newly generated BULLET_PHYSICS.vcxproj and built it under debug and release

  • Saw i had a bunch of new libs in the lib folder in msvn/BulletBuild/lib but did nothing with them

  • Followed the rest of the steps in the tutorial exactly for setting up the actual project

  • Tried to build the last line of code: FAIL

  • Wondered Do i NEED the dlls, because only .libs and pdbs showed up in the lib folder, and the tutorial didn't mention em

My only experience in rebuilding libraries is through SFML by building its msvn files included in the download and using the resulting dynamic lib and dll files. The instructions in the tutorial are very different however. (If someone could explain to me how this works it would be GREAT)

I followed the instructions exactly, multiple times but i'm not sure what i'm missing. The build works if i comment out the line of code in main but keep the include, but when i keep it i get this:

    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "void * __cdecl btAlignedAllocInternal(unsigned int,int)" (?btAlignedAllocInternal@@YAPAXIH@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "void __cdecl btAlignedFreeInternal(void *)" (?btAlignedFreeInternal@@YAXPAX@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btConvexInternalShape::getAabbSlow(class btTransform const &,class btVector3 &,class btVector3 &)const " (?getAabbSlow@btConvexInternalShape@@UBEXABVbtTransform@@AAVbtVector3@@1@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual char const * __thiscall btCollisionShape::serialize(void *,class btSerializer *)const " (?serialize@btCollisionShape@@UBEPBDPAXPAVbtSerializer@@@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: __thiscall btPolyhedralConvexShape::btPolyhedralConvexShape(void)" (??0btPolyhedralConvexShape@@QAE@XZ)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall btPolyhedralConvexShape::~btPolyhedralConvexShape(void)" (??1btPolyhedralConvexShape@@UAE@XZ)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btConvexInternalShape::setLocalScaling(class btVector3 const &)" (?setLocalScaling@btConvexInternalShape@@UAEXABVbtVector3@@@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btCollisionShape::getBoundingSphere(class btVector3 &,float &)const " (?getBoundingSphere@btCollisionShape@@UBEXAAVbtVector3@@AAM@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getAngularMotionDisc(void)const " (?getAngularMotionDisc@btCollisionShape@@UBEMXZ)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getContactBreakingThreshold(float)const " (?getContactBreakingThreshold@btCollisionShape@@UBEMM@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btCollisionShape::serializeSingleShape(class btSerializer *)const " (?serializeSingleShape@btCollisionShape@@UBEXPAVbtSerializer@@@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btBoxShape::getAabb(class btTransform const &,class btVector3 &,class btVector3 &)const " (?getAabb@btBoxShape@@UBEXABVbtTransform@@AAVbtVector3@@1@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btBoxShape::calculateLocalInertia(float,class btVector3 &)const " (?calculateLocalInertia@btBoxShape@@UBEXMAAVbtVector3@@@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall btPolyhedralConvexShape::initializePolyhedralFeatures(void)" (?initializePolyhedralFeatures@btPolyhedralConvexShape@@UAE_NXZ)
    1>C:\Libraries and Headers\Bullet\bullet-2.78\msvc\BulletTestApp\Release\BulletTestApp.exe : fatal error LNK1120: 14 unresolved externals

I know there's a link problem somewhere but i followed the instructions exactly so i don't know how to fix it. I don't see any additional dependencies when looking at the properties of the added projects if that's not how it's supposed to be... but I guess i don't understand this method of using a library in the first place though so that knowledge would help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

若无相欠,怎会相见 2024-11-25 02:26:30

好吧,显然右键单击我的 TestBulletApp 项目并单击“项目依赖项”是我出错的地方。 msVS++ 2010 由于某种原因保留了该选项,尽管它
不起作用就这样做

相反,要使项目依赖于解决方案中的其他项目,您必须右键单击您的项目(例如我的“TestBulletApp”),然后转到“属性”->“通用属性”->“框架和引用”->“项目”。添加新引用” 并添加已添加到解决方案中的依赖静态库项目,例如“bulletCollision”或其他内容;还要检查右侧的“Link Library Dependencies”是否为 True 所以,是的

,谢谢大家的提醒……“咳嗽”“咳嗽”=)

Alright, so apparently right clicking my TestBulletApp project and clicking 'Project Dependencies' was where i went wrong. msVS++ 2010 left the option there for some reason even though it
doesn't work to do it that way.

Instead to make the project dependent on the other projects in the solution you have to right click on your project like my "TestBulletApp" and go to Properties->Common Properties->Framework and References->Add New Reference" and add the depended on static library projects already added to the sollution such as 'bulletCollision' or whatever; also check that "Link Library Dependencies" is True on the right hand side.

So yeah thanks for the heads up guys..... 'cough' 'cough' =)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文