Page 1 of 1

Bullet Physics Test program crashes

Posted: Wed Nov 26, 2014 2:18 pm
by BPJ
Hi,

I discovered Bullet Physics some days ago, and now I have trouble make it run.
Yesterday, I built the libraries (for 32 bit) by myself (Windows 8.1, 64 bit, CMake 3.0.2, downgraded to MinGW 4.5.2).
Then I made a really basic program just to test out bullet (now, I am using MinGW 4.8.1 again):

Code: Select all

#include <btBulletDynamicsCommon.h>
int main()
{
    btBroadphaseInterface *broadphase = new btDbvtBroadphase();
    delete broadphase;
    return 0;
}
I compiled it with the following command:

Code: Select all

g++ -std=c++11 -O0 -Wall -o bulletTest.exe bulletTest.cpp -lBulletDynamics -lBulletCollision -lLinearMath -static
The compilation is successful, without any warnings or errors, but each time I run "bulletTest.exe" the program just crashes and Windows says "The program is not working anymore".

What do I have to do to let the program run properly?

Thanks in advance,
BPJ

Re: Bullet Physics Test program crashes

Posted: Wed Nov 26, 2014 2:30 pm
by c6burns
Isn't mixing binaries from differing mingw versions a nono? I know we've had people run into issues with mingw binary incompatibility in the Ogre forums.

Re: Bullet Physics Test program crashes

Posted: Wed Nov 26, 2014 2:34 pm
by BPJ
I already tried to compile the libraries with MinGW 4.8.1, but in this version cc1plus.exe crashes at "btInternalEdgeUtility" and causes a segmentation fault (it's a g++ bug).

Re: Bullet Physics Test program crashes

Posted: Wed Nov 26, 2014 2:53 pm
by c6burns
Right I assume there was a reason you downgraded to compile the libs, but if you compile the application with the same gcc version as the libs is the problem still there? Just trying to rule out binary incompatibility as your issue.

Re: Bullet Physics Test program crashes

Posted: Wed Nov 26, 2014 4:51 pm
by BPJ
Yesssss, it now works totally fine! I completely reinstalled MinGW (now version 4.7.2) and built the Bullet lib*.a-files. MinGW 4.5.2 had some problems with an undefined reference to some _chk*something*_ms function and couldn't use -std=c++11. So I built the libraries with 4.7.2, copied them and the include-files to 4.8.1 and everything compiles and runs successful now! I also now use "bullet-2.82-r2704" instead of "bullet3-master". So, thank you really much for your assistance!

If somebody wants to know how I did everything in detail, just ask me! :)