Bullet Physics and X64

Post Reply
Granyte
Posts: 77
Joined: Tue Dec 27, 2011 11:51 am

Bullet Physics and X64

Post by Granyte »

I just tryed recompiling bullet physics to x64 using visual studio 2010
after adding x64 configuration and changing the target machine on each project the lib seem to compile fine but the apps fail complaining that there is an incompatibilitie like a lib still using the x86 version.

Anyone tryed porting bullet to x64 befor?
bajo
Posts: 10
Joined: Wed Sep 05, 2012 5:57 pm

Re: Bullet Physics and X64

Post by bajo »

I'm also working with the x64 version of bullet. Have you also compiled the bulletbuild with 64 bits? Then it should be no problem to run your demo files.
Granyte
Posts: 77
Joined: Tue Dec 27, 2011 11:51 am

Re: Bullet Physics and X64

Post by Granyte »

well it seem my bullet didn't come with a x64 configuration and i had to create one
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Bullet Physics and X64

Post by Erwin Coumans »

Bullet comes with both 32 bit and 64 bit configurations for every platform.

If you use CMake to generate your Visual Studio projects, simply select the 64bit version of visual studio, using cmake-gui (the graphical user interface of CMake)
Here is a screenshot of the 64bit compiler selection:
cmake_64bit.png
cmake_64bit.png (70.82 KiB) Viewed 10926 times
If you use the premake to generatio Visual Studio projects, you can also select 32bit or 64bit inside Visual Studio.
Here are the steps:

1) Download Bullet 2.81 or later
2) Click on bullet\build\vs2010.bat
3) Open bullet\build\vs2010\C:\develop\bullet_latest\build\vs2010\0BulletSolution.sln
4) Select 32bit or 64bit, see screenshot:
x64.png
x64.png (43.18 KiB) Viewed 10927 times
In other words, there is no need to "port" anything. I'll add it to the user manual.
Thanks,
Erwin
Granyte
Posts: 77
Joined: Tue Dec 27, 2011 11:51 am

Re: Bullet Physics and X64

Post by Granyte »

thank's that was the issue i built only x86 with cmake
Granyte
Posts: 77
Joined: Tue Dec 27, 2011 11:51 am

Re: Bullet Physics and X64

Post by Granyte »

Is the multi-Threaded version making math with pointers? it's simply crashing when compiled to x64 not mentioning all the issues i have with it in x86 multi-threaded and ghost object
mister345
Posts: 2
Joined: Thu Dec 14, 2017 2:18 pm

Re: Bullet Physics and X64

Post by mister345 »

Hi, none of the cmake stuff works, so I copied the Bullet source files straight into my project. However, only the 64 bit version will build. When I try to build in 32 bit, it gives a bunch of errors starting with "E2474 user-defined literal operator not found" - which seems to come from definition of btAssert in btScalar.h

My project must be missing some preprocessor directive or setting or something. Please help.

Code: Select all

#ifdef BT_DEBUG
	#ifdef _MSC_VER
		#include <stdio.h>
		#define btAssert(x) { if(!(x)){printf("Assert "__FILE__ ":%u ("#x")\n", __LINE__);__debugbreak();	}}
		//#define btAssert(x)

	#else//_MSC_VER
		#include <assert.h>
		#define btAssert assert
	#endif//_MSC_VER
#else
		#define btAssert(x)
		//#define btAssert(x) { if(!(x)){printf("Assert "__FILE__ ":%u ("#x")\n", __LINE__);__debugbreak();	}}

#endif
		//btFullAssert is optional, slows down a lot
		#define btFullAssert(x)

		#define btLikely(_c)  _c
		#define btUnlikely(_c) _c
#else
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Bullet Physics and X64

Post by Erwin Coumans »

This is not really a Bullet issue but cmake issue, you may want to search elsewhere for cmake advise.

Alternatively, you can just add the Bullet source files directly into your own project, instead of using a separate cmake file.

Finally, you can also use premake, it creates projects that can switch between 32bit and 64bit.
Post Reply