2011年1月29日 星期六

How to build Chipmunk Physics 5.3.4?

The source code is located at code.google. In brief, Chipmunk Physics is a fast and lightweight 2D rigid body physics library in C.

How to get source code? Use subversion: svn checkout http://chipmunk-physics.googlecode.com/svn/trunk/ chipmunk-physics-read-only.

How to build? Chipmunk Physics only provide VS2008/2010 solutions. So we need to make our owned VS2005 solution: Make a copy of msvc/vc9 and rename it to msvc/vc8. And then modify one solution and two project files. (In the solution file, change line 2 to "Microsoft Visual Studio Solution File, Format Version 9.00" and line 3 to "# Visual Studio 2005". In two project files, change line 4 to "Version="8.00"")

Finally, open msvc/vc8/chipmunk.sln and compile all projects. Failed! Please do the following steps.
1. Redefine "cpCollisionHandler cpSpaceDefaultHandler." Please change line 45 of cpSpace.h file to "extern cpCollisionHandler cpSpaceDefaultHandler;"
2. Cannot find . It is because that the additional include directories is wrong. Please change "..\glut\include" to "..\..\glut\include"

After passing compiling. I meet another bug: Cannot find glut32.dll. Luckily, I can find glut32.dll in msvc\glut\runtime. Please copy glut32.dll to the working directory of demo.exe.

Now all projects passed sanity tests!

沒有留言:

張貼留言