Box2D主页:
http://box2d.org/
说明:Box2D需要OpenGL和相关库的支持。
参考编译脚本:
#! /bin/bash # filename: gcc_build_box2d.sh here=`pwd` if [ -d gcc_Box2D_v2.2.0 ]; then rm -rf gcc_Box2D_v2.2.0 fi export PS1=# clear unzip Box2D_v2.2.0.zip mv Box2D_v2.2.0 gcc_Box2D_v2.2.0 cd gcc_Box2D_v2.2.0/Box2D mkdir prefix ## all definition for cmake cmake_opts="\ -DBOX2D_INSTALL=ON \ -DBOX2D_BUILD_SHARED=ON \ -DCMAKE_INSTALL_PREFIX=./prefix \ -DBOX2D_BUILD_EXAMPLES=ON \ " cmake $cmake_opts make && make install
问题:
1. error: X11/extensions/XInput.h: No such file or directory
解决办法:sudo apt-get install libxi-dev
2.
参考:
http://www.cppblog.com/kongque/archive/2011/04/17/144421.html