Cocos2d-x在android中包含CCPhysicsHelper_chipmunk.h错误

时间:2014-10-10 16:32:37

标签: android cocos2d-x chipmunk

#include "chipmunk/CCPhysicsHelper_chipmunk.h"

Android上的此行错误,但iOS有效。

$ ./build_native.py

...
[armeabi] Compile++ thumb: cocos2dcpp_shared <= PEShapeCache_X3_0.cpp
jni/../../src/MenuScene.cpp:97:54: warning: missing sentinel in function call
      [-Wsentinel]
    auto menu = Menu::create(playItem, rateItem, NULL);
                                                     ^
                                                     , NULL
jni/../../cocos2d/cocos/3d/../2d/CCMenu.h:81:18: note: function has been
      explicitly marked sentinel here
    static Menu* create(MenuItem* item, ...) CC_REQUIRES_NULL_TERMINATION;
                 ^
jni/../../src/PEShapeCache_X3_0.cpp:13:10: fatal error: 
      'chipmunk/CCPhysicsHelper_chipmunk.h' file not found
#include "chipmunk/CCPhysicsHelper_chipmunk.h"
         ^
[armeabi] Compile++ thumb: cocos2dcpp_shared <= AdmobHelper.cpp
1 error generated.
make: *** [obj/local/armeabi/objs/cocos2dcpp_shared/__/__/src/PEShapeCache_X3_0.o] Error 1
make: *** Waiting for unfinished jobs....
1 warning generated.
make: Leaving directory `/Users/js/iOS_Projects/cocos2d-x/MyGame/proj.android'
Traceback (most recent call last):
  File "./build_native.py", line 159, in <module>
    build(opts.ndk_build_param,opts.android_platform,opts.build_mode)
  File "./build_native.py", line 146, in build
    do_build(cocos_root, ndk_root, app_android_root,ndk_build_param,sdk_root,android_platform,build_mode)
  File "./build_native.py", line 82, in do_build
    raise Exception("Build dynamic library for project [ " + app_android_root + " ] fails!")
Exception: Build dynamic library for project [ /Users/js/iOS_Projects/cocos2d-x/MyGame/proj.android ] fails!

任何人都知道如何解决这个问题?

1 个答案:

答案 0 :(得分:2)

错误来自本地包含 你可以在LOCAL_C_INCLUDES ...

下添加

在Android.mk文件中添加此内容

LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../cocos2d/cocos/physics