Reputation: 1320
I've had Cocos2dx project which was created in Xcode. In Xcode it's working fine, but now I need to make it work in Eclipse on Android device.
By the way, Eclipse is totally working with Xcode, I've created test project, made couple of changes, everything is fine. But when I've tried to compile my ios project, I've had couple of errors. Here is the log:
make.exe: * No rule to make target
jni/../../Classes/HelloWorldScene.cpp', needed by
obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/HelloWorldScene.o'. Stop. make.exe: * Waiting for unfinished jobs...
Very weird error, because I don't have any HelloWorldScene.cpp
file! But it's not all problems:
jni/../../Classes/GameManager.h:11:10: fatal error: 'cocosbuilder/CCBReader.h' file not found
And another one:
make.exe: *** [obj/local/armeabi/objs/cocos2dcpp_shared///Classes/AppDelegate.o] Error 1
Guys, please help me out. I was trying to change Android.mk
file, with no success. Maybe I did something wrong??
Upvotes: 3
Views: 1881
Reputation: 13459
The
proj.android/jni/Android.mk
file might not be properly configured, replace this:
LOCAL_SRC_FILES := hellocpp/main.cpp \
../../Classes/AppDelegate.cpp \
../../Classes/HelloWorldScene.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes
with this:
CPP_FILES := $(shell find $(LOCAL_PATH)/../../Classes -name *.cpp)
LOCAL_SRC_FILES := hellocpp/main.cpp
LOCAL_SRC_FILES += $(CPP_FILES:$(LOCAL_PATH)/%=%)
LOCAL_C_INCLUDES := $(shell find $(LOCAL_PATH)/../../Classes -type d)
by doing this it will automatically add all .cpp files within the "Classes" folder.
Upvotes: 3
Reputation: 6600
You should open file Android.mk
in folder proj.android/jni
and update LOCAL_SRC_FILES
attribute to CPP files, maybe it contains the link to not existing file ../../Classes/HelloWorldScene.cpp
.
Upvotes: 5