LNK2019 error still, after added libraries to linker additional dependencies
Posted: Wed Sep 23, 2020 7:12 pm
Hi,
I was trying to start up a new simple project with GUI in a new solution using the bullet library. I created this solution by adding existed porjects (Bullet3Common, BulletCollision, BulletDynamics, LinearMath, and OpenGL_Window). Initially I was having a lot of linking errors but I resolved some of them by reading lots of posts here (thanks!), here's what I have done so far:
There seems to be something wrong with OpenGL_Window_vs2010_debug.lib?
Did anyone have similar problems?
update:
I manually added these source files to my project:
Looks like it cannot resolve btShapeHull, btCollisionShape, etc... which should be included in the libraries? I don't understand
I was trying to start up a new simple project with GUI in a new solution using the bullet library. I created this solution by adding existed porjects (Bullet3Common, BulletCollision, BulletDynamics, LinearMath, and OpenGL_Window). Initially I was having a lot of linking errors but I resolved some of them by reading lots of posts here (thanks!), here's what I have done so far:
- I added those imported projects as References, to set up project dependencies
- I added the libraries path to my linker, specifically in "Configuration properties->Linker->Input->Addtional Dependencies", like below
However, I'm still getting LNK2019 error somewhere:../../bullet3-master/bin/Bullet3Common_vs2010_debug.lib
../../bullet3-master/bin/BulletCollision_vs2010_debug.lib
../../bullet3-master/bin/BulletDynamics_vs2010_debug.lib
../../bullet3-master/bin/LinearMath_vs2010_debug.lib
../../bullet3-master/bin/OpenGL_Window_vs2010_debug.lib
Code: Select all
Error LNK2019 unresolved external symbol "public: __thiscall OpenGLGuiHelper::OpenGLGuiHelper(struct CommonGraphicsApp *,bool)" (??0OpenGLGuiHelper@@QAE@PAUCommonGraphicsApp@@_N@Z) referenced in function _main App_Example App_Example.obj 1
Error LNK2019 unresolved external symbol "public: virtual __thiscall OpenGLGuiHelper::~OpenGLGuiHelper(void)" (??1OpenGLGuiHelper@@UAE@XZ) referenced in function _main App_Example App_Example.obj 1
Error LNK2019 unresolved external symbol __imp__wglCreateContext@4 referenced in function "protected: void __thiscall Win32OpenGLWindow::enableOpenGL(void)" (?enableOpenGL@Win32OpenGLWindow@@IAEXXZ) App_Example OpenGL_Window_vs2010_debug.lib(Win32OpenGLWindow.obj) 1
Error LNK2019 unresolved external symbol __imp__wglDeleteContext@4 referenced in function "protected: void __thiscall Win32OpenGLWindow::disableOpenGL(void)" (?disableOpenGL@Win32OpenGLWindow@@IAEXXZ) App_Example OpenGL_Window_vs2010_debug.lib(Win32OpenGLWindow.obj) 1
Error LNK2019 unresolved external symbol __imp__wglMakeCurrent@8 referenced in function "protected: void __thiscall Win32OpenGLWindow::disableOpenGL(void)" (?disableOpenGL@Win32OpenGLWindow@@IAEXXZ) App_Example OpenGL_Window_vs2010_debug.lib(Win32OpenGLWindow.obj) 1
Error LNK1120 5 unresolved externals App_Example App_Example.exe 1
Did anyone have similar problems?
update:
I manually added these source files to my project:
I got following new link errors:"examples/ExampleBrowser/OpenGLGuiHelper.cpp"
"examples/ExampleBrowser/GL_ShapeDrawer.cpp"
"examples/ExampleBrowser/CollisionShape2TriangleMesh.cpp"
"examples/ThirdPartyLibs/glad/gl.cpp"
Code: Select all
Error LNK2019 unresolved external symbol "public: bool __thiscall btShapeHull::buildHull(float,int)" (?buildHull@btShapeHull@@QAE_NMH@Z) referenced in function "void __cdecl CollisionShape2TriangleMesh(class btCollisionShape *,class btTransform const &,class btAlignedObjectArray<class btVector3> &,class btAlignedObjectArray<class btVector3> &,class btAlignedObjectArray<int> &)" (?CollisionShape2TriangleMesh@@YAXPAVbtCollisionShape@@ABVbtTransform@@AAV?$btAlignedObjectArray@VbtVector3@@@@2AAV?$btAlignedObjectArray@H@@@Z) App_Example CollisionShape2TriangleMesh.obj 1
Error LNK2001 unresolved external symbol "public: bool __thiscall btShapeHull::buildHull(float,int)" (?buildHull@btShapeHull@@QAE_NMH@Z) App_Example GL_ShapeDrawer.obj 1
Error LNK2001 unresolved external symbol "public: virtual void __thiscall btCollisionShape::getBoundingSphere(class btVector3 &,float &)const " (?getBoundingSphere@btCollisionShape@@UBEXAAVbtVector3@@AAM@Z) App_Example GL_ShapeDrawer.obj 1
Error LNK2001 unresolved external symbol "public: virtual float __thiscall btCollisionShape::getAngularMotionDisc(void)const " (?getAngularMotionDisc@btCollisionShape@@UBEMXZ) App_Example GL_ShapeDrawer.obj 1
Error LNK2001 unresolved external symbol "public: virtual float __thiscall btCollisionShape::getContactBreakingThreshold(float)const " (?getContactBreakingThreshold@btCollisionShape@@UBEMM@Z) App_Example GL_ShapeDrawer.obj 1
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) App_Example GL_ShapeDrawer.obj 1
Error LNK2001 unresolved external symbol "public: virtual void __thiscall btSphereShape::calculateLocalInertia(float,class btVector3 &)const " (?calculateLocalInertia@btSphereShape@@UBEXMAAVbtVector3@@@Z) App_Example GL_ShapeDrawer.obj 1
Error LNK2019 unresolved external symbol __imp__wglCreateContext@4 referenced in function "protected: void __thiscall Win32OpenGLWindow::enableOpenGL(void)" (?enableOpenGL@Win32OpenGLWindow@@IAEXXZ) App_Example Win32OpenGLWindow.obj 1
Error LNK2019 unresolved external symbol __imp__wglDeleteContext@4 referenced in function "protected: void __thiscall Win32OpenGLWindow::disableOpenGL(void)" (?disableOpenGL@Win32OpenGLWindow@@IAEXXZ) App_Example Win32OpenGLWindow.obj 1
Error LNK2019 unresolved external symbol __imp__wglMakeCurrent@8 referenced in function "protected: void __thiscall Win32OpenGLWindow::disableOpenGL(void)" (?disableOpenGL@Win32OpenGLWindow@@IAEXXZ) App_Example Win32OpenGLWindow.obj 1
Error LNK1120 9 unresolved externals App_Example App_Example.exe 1