BulletPhysics for multiple CPU architectures in VS 2010

Post Reply
User avatar
manmohan29
Posts: 15
Joined: Wed Aug 20, 2014 9:26 pm
Location: Chandigarh, India

BulletPhysics for multiple CPU architectures in VS 2010

Post by manmohan29 »

I have an OpenGL application that I am coding in Visual Studio 2010 IDE. I am building my application for two CPU architectures, and they are x86 (i.e. Win32) and x64.

CMake creates Visual Studio projects for Win32 or Win64 (only one at a time)
bcpu.png
bcpu.png (21.92 KiB) Viewed 3141 times
Following guide on this page : http://bulletphysics.org/mediawiki-1.5. ... om_scratch
I added the generated BulletDynamics, BulletCollision and LinearMath vc++ projects in my application's solution.

It works if my application has one CPU architecture.
But if I have multiple CPU architectures, as the case is, I cannot batch-build my application.

Is there a simple way to build BulletPhysics in visual studio 2010 for multiple CPU architectures ?

UPDATE :

I created VS solution for Win32 using CMake for BulletPhysics. Then I manually added x64 architecture for all the projects (BulletDynamics, BulletCollision, ...).
I can build the BulletPhysics solution alone, and .lib files are generated.

Now using the method provided on official wiki (add projects as dependency) does not seem to work with my solution.

Also linking the files in Linker input like this :
bvsconfig.png
bvsconfig.png (51.51 KiB) Viewed 3140 times
and building gives me 4 error like these :

Code: Select all

1>Win32_Window.obj : error LNK2019: unresolved external symbol "public: struct btWheelInfo & __cdecl btRaycastVehicle::addWheel(class btVector3 const &,class btVector3 const &,class btVector3 const &,float,float,class btRaycastVehicle::btVehicleTuning const &,bool)" (?addWheel@btRaycastVehicle@@QEAAAEAUbtWheelInfo@@AEBVbtVector3@@00MMAEBVbtVehicleTuning@1@_N@Z) referenced in function "void __cdecl initPhysics(void)" (?initPhysics@@YAXXZ)
1>Win32_Window.obj : error LNK2019: unresolved external symbol "public: void __cdecl btRaycastVehicle::setSteeringValue(float,int)" (?setSteeringValue@btRaycastVehicle@@QEAAXMH@Z) referenced in function "void __cdecl stepPhysics(void)" (?stepPhysics@@YAXXZ)
1>Win32_Window.obj : error LNK2019: unresolved external symbol "public: void __cdecl btRaycastVehicle::setBrake(float,int)" (?setBrake@btRaycastVehicle@@QEAAXMH@Z) referenced in function "void __cdecl stepPhysics(void)" (?stepPhysics@@YAXXZ)
1>Win32_Window.obj : error LNK2019: unresolved external symbol "public: void __cdecl btRaycastVehicle::applyEngineForce(float,int)" (?applyEngineForce@btRaycastVehicle@@QEAAXMH@Z) referenced in function "void __cdecl stepPhysics(void)" (?stepPhysics@@YAXXZ)
1>D:\Stuff\Visual C++\OpenGL series\5.3 - Bullet Physics on Vehicle Model\Win32_Window_with_OpenGL_context\x64\Debug\Win32_Window_with_OpenGL_context.exe : fatal error LNK1120: 4 unresolved externals
1>
Is there a way i can make this work easily ?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: BulletPhysics for multiple CPU architectures in VS 2010

Post by Erwin Coumans »

Use premake instead of cmake, then you will have 32bit and 64bit targets in the same visual studio solution.

Click on build3/vs2010.bat and open build3/vs2010/0MySolution.sln
Post Reply