无法编译使用子弹物理的程序



为什么我不能编译一个使用Bullet Physics的程序?

configure.ac:

PKG_CHECK_MODULES([bullet],[bullet])

src/Makefile.am:

myapp_CFLAGS = ... ${bullet_CFLAGS}
myapp_LDADD = ... ${bullet_LIBS}

试图编译它会给我以下错误:

$ LC_ALL=C make
make  all-recursive
make[1]: Entering directory '/home/me/Utveckling/myapp'
Making all in src
make[2]: Entering directory '/home/me/Utveckling/myapp/src'
depbase=`echo engine/PhysEngine.o | sed 's|[^/]*$|.deps/&|;s|.o$||'`;
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT engine/PhysEngine.o -MD -MP -MF $depbase.Tpo -c -o engine/PhysEngine.o engine/PhysEngine.cpp &&
mv -f $depbase.Tpo $depbase.Po
In file included from engine/PhysEngine.h:4:0,
                 from engine/PhysEngine.cpp:1:
/usr/include/bullet/BulletCollision/btBulletCollisionCommon.h:22:64: fatal error: BulletCollision/CollisionDispatch/btCollisionWorld.h: No such file or directory
 #include "BulletCollision/CollisionDispatch/btCollisionWorld.h"
                                                                ^
compilation terminated.
Makefile:479: recipe for target 'engine/PhysEngine.o' failed
make[2]: *** [engine/PhysEngine.o] Error 1
make[2]: Leaving directory '/home/me/Utveckling/myapp/src'
Makefile:364: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/me/Utveckling/myapp'
Makefile:305: recipe for target 'all' failed
make: *** [all] Error 2

我已经安装了Ubuntu软件包libbullet-dev,并且文件存在于文件系统中。

我自己找到了解决办法。

不是

myapp_CFLAGS = ... ${bullet_CFLAGS}
我应该用
myapp_CPPFLAGS = ... ${bullet_CFLAGS}

最新更新