无法编译使用Bullet Physics的程序

时间:2016-10-24 09:56:40

标签: c++ compilation bulletphysics

为什么我不能编译使用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,文件存在于文件系统中。

1 个答案:

答案 0 :(得分:0)

自己找到解决方案。

而不是

myapp_CFLAGS = ... ${bullet_CFLAGS}

我应该使用

myapp_CPPFLAGS = ... ${bullet_CFLAGS}
相关问题