I'm new to C++, Visual Studio (2019) and Bullet (2.89). I've been tying to build the Hello_World.cpp from Bullet for the past few days but I'm stuck on these 5 linking errors:
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)
There are other people who had this or a similar problem but got no answer or it didn't work for me.
setup:
- I used premake to set up the VS solution, Bullet is organized in static Libraries (as projects with source code that gets compiled to lib files) and I am now trying to link them with an application-project.
- all projects are using static linking (for debug).
- I've referenced all bullet projects to my project.
- I've even staticly linked to the lib files from bullet (and the linker can apparently see these files, I even tried giving the absolute path)
- As far as I can tell the functions exist and have the same signature in the .cpp and .h files
If you need more details let me know.
(One lead I possibly got is something about different bt_double_precision? But that might not be it and the only think I could find was floating point model using different precision. But making that the same didn't do anything)
Thanks in advance!
EDIT: I don't think this answer applies to me
What is an undefined reference/unresolved external symbol error and how do I fix it?
EDIT: Maybe worth mentioning: The file structure of the project is really weird (dictated by premake):
- solution and project files are in: bullet3-2.89\build3\vs2010
- high level header files(these are the ones used by Hello_World that include other headers): bullet3-2.89\src
- source and header files are subdirectories of bullet3-2.89\src
- libraries: bullet3-2.89\bin but all headers use the correct relative paths in their include and I have set the project's include and library directories to those locations