Can't even build the "Hello World" Project

lildragon555
Posts: 7
Joined: Sat May 21, 2011 12:18 am

Can't even build the "Hello World" Project

Post by lildragon555 »

After finally believing to setting up Bullet on Visual Studio 2010, I tried to build the "Hello Project" on the wiki, but it comes up with the "Error LNK2019" about an unresolved external symbol...gonna guess something is not linked...

This is the build output:

Code: Select all

1>------ Build started: Project: BulletDynamics, Configuration: Debug Win32 ------
2>------ Build started: Project: BulletCollision, Configuration: Debug Win32 ------
3>------ Build started: Project: LinearMath, Configuration: Debug Win32 ------
2>  Building Custom Rule C:/bullet-2.78/src/BulletCollision/CMakeLists.txt
1>  Building Custom Rule C:/bullet-2.78/src/BulletDynamics/CMakeLists.txt
1>  The system cannot find the path specified.
2>  The system cannot find the path specified.
3>  Building Custom Rule C:/bullet-2.78/src/LinearMath/CMakeLists.txt
3>  The system cannot find the path specified.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3.
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3.
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3.
4>------ Build started: Project: RacingGameProject, Configuration: Debug Win32 ------
4>  main.cpp
4>main.obj : error LNK2019: unresolved external symbol "public: __thiscall btDiscreteDynamicsWorld::btDiscreteDynamicsWorld(class btDispatcher *,class btBroadphaseInterface *,class btConstraintSolver *,class btCollisionConfiguration *)" (??0btDiscreteDynamicsWorld@@QAE@PAVbtDispatcher@@PAVbtBroadphaseInterface@@PAVbtConstraintSolver@@PAVbtCollisionConfiguration@@@Z) referenced in function _main
4>main.obj : error LNK2019: unresolved external symbol "public: __thiscall btSequentialImpulseConstraintSolver::btSequentialImpulseConstraintSolver(void)" (??0btSequentialImpulseConstraintSolver@@QAE@XZ) referenced in function _main
4>main.obj : error LNK2019: unresolved external symbol "public: __thiscall btCollisionDispatcher::btCollisionDispatcher(class btCollisionConfiguration *)" (??0btCollisionDispatcher@@QAE@PAVbtCollisionConfiguration@@@Z) referenced in function _main
4>main.obj : error LNK2019: unresolved external symbol "public: __thiscall btDefaultCollisionConfiguration::btDefaultCollisionConfiguration(struct btDefaultCollisionConstructionInfo const &)" (??0btDefaultCollisionConfiguration@@QAE@ABUbtDefaultCollisionConstructionInfo@@@Z) referenced in function _main
4>main.obj : error LNK2019: unresolved external symbol "public: __thiscall btDbvtBroadphase::btDbvtBroadphase(class btOverlappingPairCache *)" (??0btDbvtBroadphase@@QAE@PAVbtOverlappingPairCache@@@Z) referenced in function _main
4>C:\Users\Joseph\documents\visual studio 2010\Projects\RacingGameProject\Debug\RacingGameProject.exe : fatal error LNK1120: 5 unresolved externals
========== Build: 0 succeeded, 4 failed, 0 up-to-date, 0 skipped ==========
And my code is exact same as the one on the wiki. I followed the installation to every letter even doing more than once...If anyone can help, I'd be glad.
Karrok
Posts: 65
Joined: Fri May 13, 2011 1:11 pm

Re: Can't even build the "Hello World" Project

Post by Karrok »

You're missing libs (BulletDynamics.lib , BulletCollision.lib and LinearMath.lib in your additional dependancies in linker -> input
lildragon555
Posts: 7
Joined: Sat May 21, 2011 12:18 am

Re: Can't even build the "Hello World" Project

Post by lildragon555 »

Karrok wrote:You're missing libs (BulletDynamics.lib , BulletCollision.lib and LinearMath.lib in your additional dependancies in linker -> input
Finally someone actually responds to one of my threads...I thought this forum was a ghost town...
Hm...I should have known something like that..

EDIT:
After adding the libraries, it seems to be unable to link to the BulletDynamics.lib...do you know where they are located?

Code: Select all

1>------ Build started: Project: LinearMath, Configuration: Debug Win32 ------
2>------ Build started: Project: BulletDynamics, Configuration: Debug Win32 ------
3>------ Build started: Project: BulletCollision, Configuration: Debug Win32 ------
2>  Building Custom Rule C:/bullet-2.78/src/BulletDynamics/CMakeLists.txt
2>  The system cannot find the path specified.
3>  Building Custom Rule C:/bullet-2.78/src/BulletCollision/CMakeLists.txt
3>  The system cannot find the path specified.
1>  Building Custom Rule C:/bullet-2.78/src/LinearMath/CMakeLists.txt
1>  The system cannot find the path specified.
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3.
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3.
4>------ Build started: Project: RacingGameProject, Configuration: Debug Win32 ------
4>LINK : fatal error LNK1104: cannot open file 'BulletDynamics.lib'
========== Build: 0 succeeded, 4 failed, 0 up-to-date, 0 skipped ==========
Also the

Code: Select all

1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3.
is still an issue...
Karrok
Posts: 65
Joined: Fri May 13, 2011 1:11 pm

Re: Can't even build the "Hello World" Project

Post by Karrok »

are you using Cmake to make your .sln or are you just using the .sln located in the msvc directory ?

Its advised to just use Cmake to make your project.

All Bullet libs should be built before building any of the demos.
lildragon555
Posts: 7
Joined: Sat May 21, 2011 12:18 am

Re: Can't even build the "Hello World" Project

Post by lildragon555 »

How would you do that? Because I'm just in VS 2010 and then trying to build the solution from there.
If I try to go find the .libs, there are none. So I have no idea what I'm doing wrong.
easablade
Posts: 4
Joined: Thu May 26, 2011 9:49 am

Re: Can't even build the "Hello World" Project

Post by easablade »

You have to build the libs first. I have done this for both VS2010 and QT. I then put the created libs (.lib for VS2010 and .a for QT) in the bullet libs directory.
lildragon555
Posts: 7
Joined: Sat May 21, 2011 12:18 am

Re: Can't even build the "Hello World" Project

Post by lildragon555 »

easablade wrote:You have to build the libs first. I have done this for both VS2010 and QT. I then put the created libs (.lib for VS2010 and .a for QT) in the bullet libs directory.
That's the thing, I don't know how to build the libs...I made another thread before and no one answered...
Karrok
Posts: 65
Joined: Fri May 13, 2011 1:11 pm

Re: Can't even build the "Hello World" Project

Post by Karrok »

again, are you using cmake or just opening the .sln that is supplied?

In other words, do you have a "project" called ALL_BUILD ? if not, then you should just use Cmake to generate the project for bullet.
It (more or less) automatically ensures your paths and build order is set properly.
dumbo2007
Posts: 66
Joined: Sun Jan 30, 2011 8:46 pm

Re: Can't even build the "Hello World" Project

Post by dumbo2007 »

Ok first off, Bullet works smoothly and does build smoothly in Windows using Visual Studio also. The problem seems to be that you havent built the BULLET_PHYSICS project.

So if you go to BulletExtractionDirectory\bullet-2.77\msvc\2008 there you will find the file BULLET_PHYSICS.sln which is the visual studio solution file containing a number of Bullet Projects. Can you try building this solution please ?

Also are you sure you extracted Bullet correctly with no missing folders ? You should have at least
apidocs
Demos
Extras
Glut
lib
msvc
src
UnitTests

Note that I am using version 2.77
lildragon555
Posts: 7
Joined: Sat May 21, 2011 12:18 am

Re: Can't even build the "Hello World" Project

Post by lildragon555 »

Thanks for you help...building that solution first and then using CMake worked for me...
However, it can't open BulletDynamics.lib...
dumbo2007
Posts: 66
Joined: Sun Jan 30, 2011 8:46 pm

Re: Can't even build the "Hello World" Project

Post by dumbo2007 »

Well you wouldn't need to use CMAKE after you build the solution. The build generates the .lib files for use in your projects. Are you sure BulletDynamics.lib is present in the linker include settings in Visual Studio ?
lildragon555
Posts: 7
Joined: Sat May 21, 2011 12:18 am

Re: Can't even build the "Hello World" Project

Post by lildragon555 »

Yes...it's all in there...
This is my current Linker Setting

Code: Select all

OpenGL32.Lib
GlU32.Lib
freeglut.lib
glew32.lib
BulletDynamics.lib
BulletCollision.lib
LinearMath.lib