cocos2dx 3.1.1 box2d.h : No such file or directory

前端之家收集整理的这篇文章主要介绍了cocos2dx 3.1.1 box2d.h : No such file or directory前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。


由于要用到Box2d做物理引擎,于是就在cocos2dx里面加入libBox2Dx,详细设置参考

http://blog.csdn.net/tonny_guan/article/details/39859577。

在vs2012下面编译都没有错误,但是安卓编译的时候就报错了,Box2d.h : No such file or directory。

搜索了半天,问题出在\proj.android\jni\Android.mk。这个文件默认情况下是


LOCAL_PATH := $(call my-dir)


include $(CLEAR_VARS)


LOCAL_MODULE := cocos2dcpp_shared


LOCAL_MODULE_FILENAME := libcocos2dcpp


LOCAL_SRC_FILES := hellocpp/main.cpp \
../../Classes/GLES-Render.cpp \
../../Classes/AppDelegate.cpp \
../../Classes/HelloWorldScene.cpp


LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes


LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static


#LOCAL_WHOLE_STATIC_LIBRARIES += Box2d_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static
# LOCAL_WHOLE_STATIC_LIBRARIES += spine_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static

include $(BUILD_SHARED_LIBRARY)

$(call import-module,.)
$(call import-module,audio/android)

#$(call import-module,external/Box2D)
# $(call import-module,editor-support/cocosbuilder)
# $(call import-module,editor-support/spine)
# $(call import-module,editor-support/cocostudio)
# $(call import-module,network)
# $(call import-module,extensions)


所以你将上面中两句红色的语句前面的#去掉就可以了,类似的如果你用到extensions,就将上面的应用注释去掉。

原文链接:https://www.f2er.com/cocos2dx/345131.html

猜你在找的Cocos2d-x相关文章