Sign in to follow this  
BiiXteR

I can't build the Box2D physics library in Visual Studio 2015

Recommended Posts

As the title says I'm having problems when trying to build the Box2D physics library using Visual Studio 2015.

 

I'm trying to build the vs2015 version of Box2D, and I have it set to debug mode.

However when I try to build it, it gives me a ton of errors : 

 

  • (error) C2220 : Warning treated as error - no 'object' file generated : b2CollideCircle.cpp : Line 141
  • (warning) C4456 : declaration of 'separation' hides previous local declaration : b2CikkudeCircle.cpp : Line 141
  • (error) C2220 : warning treated as error - no 'object' file generated : b2Island.cpp : Line 315
  • (warning) C4456 : declaration of 'i' hides previous local declaration : b2Island.cpp : Line 315
  • (error) C2220 : warning treated as error - no 'object' file generated : b2ContactSolver.cpp : Line 348
  • (warning) C4456 : declaration 'i' hides previous local declaration : b2ContactSolver.cpp : Line 348
  • (error) C2220 : warning treated as error - no 'object' file generated : b2WheelJoint.cpp : Line : 144
  • (warning) C4456 : declaration of 'd' hides previous local declaration : b2WheelJoint.cpp : Line 144

 

I'm also getting these outputs from the build : 

 

  • 1>..\..\Box2D\Collision\b2CollideCircle.cpp(141): error C2220: warning treated as error - no 'object' file generated
  • 1>..\..\Box2D\Collision\b2CollideCircle.cpp(141): warning C4456: declaration of 'separation' hides previous local declaration
  • 1>  ..\..\Box2D\Collision\b2CollideCircle.cpp(141): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
  • 1>  ..\..\Box2D\Collision\b2CollideCircle.cpp(64): note: see declaration of 'separation'
  • 1>..\..\Box2D\Dynamics\b2Island.cpp(315): error C2220: warning treated as error - no 'object' file generated
  • 1>..\..\Box2D\Dynamics\b2Island.cpp(315): warning C4456: declaration of 'i' hides previous local declaration
  • 1>  ..\..\Box2D\Dynamics\b2Island.cpp(315): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
  • 1>  ..\..\Box2D\Dynamics\b2Island.cpp(310): note: see declaration of 'i'
  • 1>..\..\Box2D\Dynamics\Contacts\b2ContactSolver.cpp(348): error C2220: warning treated as error - no 'object' file generated
  • 1>..\..\Box2D\Dynamics\Contacts\b2ContactSolver.cpp(348): warning C4456: declaration of 'i' hides previous local declaration
  • 1>  ..\..\Box2D\Dynamics\Contacts\b2ContactSolver.cpp(348): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
  • 1>  ..\..\Box2D\Dynamics\Contacts\b2ContactSolver.cpp(293): note: see declaration of 'i'
  • 1>..\..\Box2D\Dynamics\Joints\b2WheelJoint.cpp(144): error C2220: warning treated as error - no 'object' file generated
  • 1>..\..\Box2D\Dynamics\Joints\b2WheelJoint.cpp(144): warning C4456: declaration of 'd' hides previous local declaration
  • 1>  ..\..\Box2D\Dynamics\Joints\b2WheelJoint.cpp(144): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
  • 1>  ..\..\Box2D\Dynamics\Joints\b2WheelJoint.cpp(106): note: see declaration of 'd'

 

I'm using the latest version of Box2D which I downloaded on n their github page : click me to view download

 

Not sure what else I should add.

Edited by BiiXteR

Share this post


Link to post
Share on other sites
You may have warning levels set on your project to treat warnings as errors (/WX). Usually these warnings indicate a possible bug with your code, but since this isn’t your code, you may be safe in ignoring these warnings.


Relevant code in b2CollideCircle:
	// Find the min separating edge.
	int32 normalIndex = 0;
	float32 separation = -b2_maxFloat;                            // (line 64)
	float32 radius = polygonA->m_radius + circleB->m_radius;
	int32 vertexCount = polygonA->m_count;
	const b2Vec2* vertices = polygonA->m_vertices;
	const b2Vec2* normals = polygonA->m_normals;

?
?

		b2Vec2 faceCenter = 0.5f * (v1 + v2);
		float32 separation = b2Dot(cLocal - faceCenter, normals[vertIndex1]);  // (line 141)
		if (separation > radius)
		{
			return;
		}

Share this post


Link to post
Share on other sites

You may have warning levels set on your project to treat warnings as errors (/WX). Usually these warnings indicate a possible bug with your code, but since this isn’t your code, you may be safe in ignoring these warnings.


Relevant code in b2CollideCircle:

	// Find the min separating edge.
	int32 normalIndex = 0;
	float32 separation = -b2_maxFloat;                            // (line 64)
	float32 radius = polygonA->m_radius + circleB->m_radius;
	int32 vertexCount = polygonA->m_count;
	const b2Vec2* vertices = polygonA->m_vertices;
	const b2Vec2* normals = polygonA->m_normals;

?
?

		b2Vec2 faceCenter = 0.5f * (v1 + v2);
		float32 separation = b2Dot(cLocal - faceCenter, normals[vertIndex1]);  // (line 141)
		if (separation > radius)
		{
			return;
		}

 

My warning level was set to /W4 however it was also set to threat warnings as errors.

Setting it to no and setting warning level to /W3 solved the problem, thanks! :)

Edited by BiiXteR

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this