我是C ++,Visual Studio(2019)和Bullet(2.89)的新手。在过去的几天里,我一直在尝试从Bullet构建Hello_World.cpp,但我一直陷在这5个链接错误中:
1>Hello_World.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btCollisionShape::getBoundingSphere(class btVector3 &,float &)const " (?getBoundingSphere@btCollisionShape@@UBEXAAVbtVector3@@AAM@Z)
1>Hello_World.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getAngularMotionDisc(void)const " (?getAngularMotionDisc@btCollisionShape@@UBEMXZ)
1>Hello_World.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getContactBreakingThreshold(float)const " (?getContactBreakingThreshold@btCollisionShape@@UBEMM@Z)
1>Hello_World.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btConvexShape::project(class btTransform const &,class btVector3 const &,float &,float &,class btVector3 &,class btVector3 &)const " (?project@btConvexShape@@UBEXABVbtTransform@@ABVbtVector3@@AAM2AAV3@3@Z)
1>Hello_World.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btSphereShape::calculateLocalInertia(float,class btVector3 &)const " (?calculateLocalInertia@btSphereShape@@UBEXMAAVbtVector3@@@Z)
[还有其他人遇到此问题或类似问题,但没有答案或对我不起作用。
设置:
如果您需要更多详细信息,请告诉我。
((我可能得到的一个线索是关于不同的bt_double_precision的东西?但是那可能不是,唯一能想到的就是我使用不同的精度的浮点模型。但是使之无所作为)
提前感谢!
编辑:我认为此答案不适用于我
What is an undefined reference/unresolved external symbol error and how do I fix it?
编辑:也许值得一提:该项目的文件结构确实很奇怪(由premake决定):
我找到了解决方法。只是要劫持Bullet的示例项目之一,而是改用它。他们在VS设置上似乎比我更好:D无论如何,谢谢您的建议。