Page 1 of 1

Bullet Physics and X64

Posted: Thu Nov 08, 2012 1:26 am
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?

Re: Bullet Physics and X64

Posted: Fri Nov 09, 2012 12:14 am
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.

Re: Bullet Physics and X64

Posted: Fri Nov 09, 2012 1:06 pm
by Granyte
well it seem my bullet didn't come with a x64 configuration and i had to create one

Re: Bullet Physics and X64

Posted: Fri Nov 09, 2012 5:36 pm
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 10940 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 10941 times
In other words, there is no need to "port" anything. I'll add it to the user manual.
Thanks,
Erwin

Re: Bullet Physics and X64

Posted: Fri Nov 09, 2012 6:28 pm
by Granyte
thank's that was the issue i built only x86 with cmake

Re: Bullet Physics and X64

Posted: Sat Nov 10, 2012 3:46 am
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

Re: Bullet Physics and X64

Posted: Sat Dec 16, 2017 7:39 am
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

Re: Bullet Physics and X64

Posted: Fri Dec 22, 2017 11:39 pm
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.