cocos2d-x 遇到的错误与解决方法。make: *** No rule to make target `/cygdrive/d/android/cocos2d-x-master/T12/proj.android/../../cocos2dx/xxxxx.cpp'

时间:2021-01-22 17:10:25

cocos2d-x 遇到的错误与解决方法。make: *** No rule to make target `/cygdrive/d/android/cocos2d-x-master/T12/proj.android/../../cocos2dx/xxxxx.cpp', needed by `obj/local/armeabi/objs/cocos2dx_static/xxxxx.o'. Stop.

解决方法:

用记事本编辑 proj.android\jni\Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := hellocpp_shared

LOCAL_MODULE_FILENAME := libhellocpp

LOCAL_SRC_FILES := hellocpp/main.cpp \

../../Classes/AppDelegate.cpp \

../../Classes/HelloWorldScene.cpp \

../../Classes/Actor.cpp \

../../Classes/xxxxx.cpp

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

LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static

include $(BUILD_SHARED_LIBRARY)

$(call import-module,cocos2dx)

一定要确定 ../../Classes/xxxxx.cpp 文件名没有写错。