another double precision build error

jackskelyton
Posts: 32
Joined: Mon Nov 05, 2007 3:52 pm

another double precision build error

Post by jackskelyton »

When I add #define BT_USE_DOUBLE_PRECISION 1 at the top of LinearMath/btScalar.h, I get the following error:

1>Project : error PRJ0019: A tool returned an error code from "Performing Post-Build Event..."

What does that mean?

Also: when I set double precision, rebuild the libbulletcollision, libbulletdynamics, and libbulletmath from the SDK wksbullet.sln, and then put that code into my game, I get a whole host of linking errors that refer to all the collision shape and rigid body constructors... things like this:

1>PhysicsObject.obj : error LNK2019: unresolved external symbol "public: __thiscall btSphereShape::btSphereShape(double)" (??0btSphereShape@@QAE@N@Z) referenced in function "public: void __thiscall PhysicsObject::BuildCollisionSphere(double)" (?BuildCollisionSphere@PhysicsObject@tank@@QAEXN@Z)

Anyone know what do about this?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: another double precision build error

Post by Erwin Coumans »

jackskelyton wrote:When I add #define BT_USE_DOUBLE_PRECISION 1 at the top of LinearMath/btScalar.h, I get the following error:
1>Project : error PRJ0019: A tool returned an error code from "Performing Post-Build Event..."
What does that mean?
It probably means that it didn't build the double precision library properly. The projectfiles have a double precision build configuration, so you shouldn't need to change the source code.
Also: when I set double precision, rebuild the libbulletcollision, libbulletdynamics, and libbulletmath from the SDK wksbullet.sln, and then put that code into my game, I get a whole host of linking errors that refer to all the collision shape and rigid body constructors... things like this:
1>PhysicsObject.obj : error LNK2019: unresolved external symbol "public: __thiscall btSphereShape::btSphereShape(double)" (??0btSphereShape@@QAE@N@Z) referenced in function "public: void __thiscall PhysicsObject::BuildCollisionSphere(double)" (?BuildCollisionSphere@PhysicsObject@tank@@QAEXN@Z)
It sounds like it is linking against the wrong library (single float precision?). It would be better if the double precision libraries have a different name including 'dbl' postfix. Unfortunately the projectfiles have been autogenerated using msvcgen+jam and digging the templates consumes a lot of time.
Can you clean the project, and delete the files in the lib folder and rebuild the double precision library?

Alternatively, can you try to use cmake to create the Bullet libraries (http://cmake.org, Bullet provides CMakeLists.txt)?

Hope this helps,
Erwin
jackskelyton
Posts: 32
Joined: Mon Nov 05, 2007 3:52 pm

Re: another double precision build error

Post by jackskelyton »

Well, not quite. In response to your suggestions, I did this:

I extracted a new copy of the Bullet SDK (v2.63), opened it up in VS2005, opened the properties for the wksbullet solution and changed the configuration from Debug to DebugDoublePrecision. Then I built the solution and got 23 successful builds and 13 failed builds. If I try to build libbulletdynamics, libbulletcollision, or linearmath projects individually, they all fail with that same error code I mentioned before.

I see there were new libraries created, and despite the build errors I tried moving those into my game and modifying the include property to look for them. Still no luck---in fact, I get all kinds of conversion warnings indicating that btScalar has not been redefined to a double. What now?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: another double precision build error

Post by Erwin Coumans »

2.63 is an older version of Bullet, it might be that double-precision builds are broken for that version (double-precision has not been tested for each release, we should do this nevertheless).

In any case, please make sure NOT to change btScalar.h (don't add BT_USE_DOUBLE_PRECISION manually), but always add the BT_USE_DOUBLE_PRECISION define as a preprocessor define (-DBT_USE_DOUBLE_PRECISION or MSVC build configuration).

The current trunk of the Bullet Subversion repository should compile fine out-of-the-box for double precision, we tested this yesterday. Perhaps you should wait for Bullet 2.67, which will be available within a week or two, is that ok?

Thanks,
Erwin
jackskelyton
Posts: 32
Joined: Mon Nov 05, 2007 3:52 pm

Re: another double precision build error

Post by jackskelyton »

Ok, I grabbed the bullet sdk out of your subversion trunk and it compiles fine on my machine, so there's that. But when I move the created libs into my game, they still don't work: I get warnings indicating that btScalar is still a float. Is there more to that simply to replace the three libraries and the source code in my "include" and "lib" directories and rebuild?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: another double precision build error

Post by Erwin Coumans »

jackskelyton wrote:Ok, I grabbed the bullet sdk out of your subversion trunk and it compiles fine on my machine, so there's that. But when I move the created libs into my game, they still don't work: I get warnings indicating that btScalar is still a float. Is there more to that simply to replace the three libraries and the source code in my "include" and "lib" directories and rebuild?
If you want to use the double precision version, every project in your game that includes a Bullet headerfile also needs this 'BT_USE_DOUBLE_PRECISION' define. Did you add that to the C++ preprocessor definitions?
jackskelyton
Posts: 32
Joined: Mon Nov 05, 2007 3:52 pm

Re: another double precision build error

Post by jackskelyton »

aha, that was it! Thanks, Erwin :)