android build problem!!!


HI My project is build success on Xcode! but android get error!

Compile*+ thumb : game_shared <= CGameScene.cpp
Compile*+ thumb : game_shared <= SpriteBlur.cpp
Compile*+ thumb : game_shared <= CLoading.cpp
make: * No rule to make target `jni/…/…/Classes/lookingPicture/CTansFormScene.cpp’, needed by `obj/local/armeabi/objs-debug/game_shared///Classes/lookingPicture/CTansFormScene.o’. Stop.
I ’d like to know What different between iOS and android with C*+?? (0.6 KB)

归档.zip (1.8 KB)


Copy - pasting what I said here

You need to add your CPP files in the jni/ file. Look for the line that says LOCAL_SRC_FILES

It should look like this:

LOCAL_SRC_FILES := helloworld/main.cpp \
                   ../../Classes/AppDelegate.cpp \
                   ../../Classes/HelloWorldScene.cpp \
                   ../../Classes/MyOwnClass1.cpp \
                   ../../Classes/MyOwnClass2.cpp \

Add all the CPP below the HelloWorldScene.cpp line and add a at the end. When you get to the last file, do not add


Lance Gray! thanks , I know the, and I have done it as the same as you! sometimes,It can build successful! for example!

It can build successful!
…/…/Classes/AppDelegate.cpp …/…/Classes/HelloWorldScene.cpp …/…/Classes/MyOwnClass1.cpp …/…/Classes/MyOwnClass2.cpp

but I change the position MyOwnClass1 to MyOwnClass2 like this , It build error!
…/…/Classes/AppDelegate.cpp …/…/Classes/HelloWorldScene.cpp …/…/Classes/MyOwnClass2.cpp …/…/Classes/MyOwnClass1.cpp


I’m not sure why that happens. I usually add my files alphabetically since that’s the way it appears on the Project Explorer. Maybe MyOwnClass2 depends on MyOwnClass1. Can you pose the build error you get?


thanks a lot! I sovle this problem. I merge CTransFormScene.cpp file to other file! It can not be writen in one cpp file! I do not know why? but It can build successful! My platform is mac!