VC6 and version 2.75 Fixing compilation errors

sgoudge
Posts: 2
Joined: Tue Dec 22, 2009 6:53 pm

VC6 and version 2.75 Fixing compilation errors

Post by sgoudge »

Hello,

I have just downloaded Bullet v2.75 and tried the VC6 build - unfortunately there are a couple of places in the library sources which upset VC6:

src\BulletDynamics\ConstraintSolver\btGeneric6DofSpringConstraint.cpp
line 71 within btGeneric6DofSpringConstraint::setEquilibriumPoint()

src\BulletSoftBody\btSoftBody.cpp
line 530 within btSoftBody::setVolumeMass()

both of these are the old "VC6 treats 'for(int i=..' differently" issue, which means that VC6 is seeing (in both routines) 'i' being re-declared. To get them to compile I just did the old "put an extra set of braces round the loop" fix, so for the first one:

Code: Select all

void btGeneric6DofSpringConstraint::setEquilibriumPoint()
{
	calculateTransforms();
	for(int i = 0; i < 3; i++)
	{
		m_equilibriumPoint[i] = m_calculatedLinearDiff[i];
	}
	for(int i = 0; i < 3; i++)
	{
		m_equilibriumPoint[i + 3] = m_calculatedAxisAngleDiff[i];
	}
}
becomes:

Code: Select all

void btGeneric6DofSpringConstraint::setEquilibriumPoint()
{
	calculateTransforms();
	{for(int i = 0; i < 3; i++)
	{
		m_equilibriumPoint[i] = m_calculatedLinearDiff[i];
	}}
	{for(int i = 0; i < 3; i++)
	{
		m_equilibriumPoint[i + 3] = m_calculatedAxisAngleDiff[i];
	}}
}
and the same technique fixes up setVolumeMass() as well.

Regards,
Stephen
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: VC6 and version 2.75 Fixing compilation errors

Post by Erwin Coumans »

Thanks for the report.

It has been fixed in the latest trunk, can you check it?

Cheers,
Erwin
sgoudge
Posts: 2
Joined: Tue Dec 22, 2009 6:53 pm

Re: VC6 and version 2.75 Fixing compilation errors

Post by sgoudge »

Thank you - the version in the curent bullet-trunk.zip built perfectly from the provided VC6 workspace. Just had my first run of the demo app - brilliant!

Regards,
Stephen