Unable to start cocos2dx ios project in android

I had a Cocos2dx project that was created in Xcode. It works fine in Xcode, but now I need to get it to work in Eclipse on an android device.

BTW, Eclipse works completely with Xcode, I created a test project, made a couple of changes, everything is fine. But when I tried to compile my ios project I got several errors. Here is the log:

make.exe: * No rule for creating target jni/../../Classes/HelloWorldScene.cpp', needed by

object / local / armeabi / OBJS / cocos2dcpp_shared / __ / __ / Classes / HelloWorldScene.o. Stop. make.exe: *
Waiting for unfinished jobs ...

Very strange error because I don't have a file HelloWorldScene.cpp

! But these are not all problems:

jni /../../ Classes / GameManager.h: 11:10: fatal error: File "cocosbuilder / CCBReader.h" not found

And one more:

make.exe: *** [Object / local / armeabi / OBJS / cocos2dcpp_shared / / /Classes/AppDelegate.o] Error 1

Guys, please help me. I tried to modify the file Android.mk

, with no success. Maybe I did something wrong?

+3


source to share


2 answers


You should open the file Android.mk

in the folder proj.android/jni

and update the attribute LOCAL_SRC_FILES

for CPP files, it may contain a link to a file that does not exist ../../Classes/HelloWorldScene.cpp

.



+5


source


proj.android/jni/Android.mk

the file may not be configured correctly, 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 to the Classes folder.

+3


source







All Articles