About android project with box2d integrated issuses --libgame.so can't create

About android project with box2d integrated issuses --libgame.so can't create
0.0 0



i was using cocos2dx-2.0.4 to create an android project with box2d integrated,
preliminary,everything goes ok,but when i use box2d classes,some issuses occor.

such as the libgame.so can’t be created.

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := game_shared


LOCAL_SRC_FILES := hellocpp/main.cpp …/…/Classes/AppDelegate.cpp …/…/Classes/HelloWorldScene.cpp …/…/Classes/DrawLines.cpp …/…/Classes/PhysicsSprite.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/…/…/Classes $(LOCAL_PATH)/external/Box2D/

LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static cocos_extension_static box2d_static


$(call import-module,CocosDenshion/android) $(call import-module,cocos2dx) $(call import-module,extensions) $(call import-module,external/Box2D)

this is the Android.mk file,
if i remove the line

it run perfectly,
but if i add this line libgame.so can’t be created

in Application.mk

APP_STL := gnustl_static
APP_CPPFLAGS := -frtti
APP_MODULES := cocos2dx_static cocosdenshion_static box2d_static

in PhysicsSprite.cpp i include “box2d.h”

somebody help me?


What’s the error?


it was this line in Application.mk

APP_MODULES := cocos2dx_static cocosdenshion_static box2d_static

that cause the error

when i add this line the project can be built, but can not create the libgame.so so as the game_shared folder in objs-debug.

so i removed this line and build, but something wrong also occor.
it can not find the header file “Box2D.h” in classes that contains Box2D calling.

finally,i solved this problem by
override this line

#include “Box2D.h”


#include “Box2D/Box2D.h”

so the project run perfectly?

can you tell me the reason why?

ps: i was using cocos2dx-2.0.4