Problems using cocos console to build project

Hi,

I have created a Cocos2d-X game using the version 3.10 and Visual Studio and now I would like to test it on Android and iOS.

The problem is that when I execute the command: cocos compile -p android I get the following errors during the build:

At global scope:
cc1plus.exe: warning: unrecognized command line option "-Wno-extern-c-compat"
cc1plus.exe: warning: unrecognized command line option "-Wno-extern-c-compat"
make.exe: Leaving directory `C:/MyGame/proj.android'
Error running command, return code: 2.

I’ve tried to do is addind all of my source and header files to the CMakeLists.txt file and removing the HelloWorldScene files from it.

Is there anything else that I should configure on this file? Do I have to configure my project in Eclipse before running the compilation?

The funny thing is that if I run the cocos compile -p android command again I get another error:

Android NDK: WARNING: APP_PLATFORM android-21 is larger than android:minSdkVersion 9 in ./AndroidManifest.xml
make.exe: Entering directory `C:/MyGame/proj.android'
[armeabi] Gdbserver      : [arm-linux-androideabi-4.9] libs/armeabi/gdbserver
make.exe: *** No rule to make target `jni/../../Classes/HelloWorldScene.cpp', needed by `obj/local/armeabi/objs-debug/co
[armeabi]c Gdbsetup       :o libs/armeabi/gdb.setups2dcpp_shared/__/__/Classes/HelloWorldScene.o'
.  Stop.
make.exe: *** Waiting for unfinished jobs....
make.exe: Leaving directory `C:/MyGame/proj.android'
Error running command, return code: 2.

Which seems strange, since I have removed the HelloWorldScene files and its reference from the CMakeLists.txt.

This is just a warning. I think there must be another error?

This also seems weird.

For running in android you have to make changes in the “Android.mk” folder.
You have to make the entry of all the .cpp files into it.

And ya
cc1plus.exe: warning: unrecognized command line option “-Wno-extern-c-compat”

It is just a warning, no need to worry about that.

Hi,

Indeed my problem was that I hadn’t configured the Android.mk file just like @Dhiraj0116, said. Once I did it I was able to compile and deploy my game without any problems! :smile:

1 Like