I've followed this tutorial http://www.raywenderlich.com/33750/cocos2d-x-tutorial-for-ios-and-android-getting-started, and managed to create an android hello world project in cococs2d-x. Now when I add anything to my classes directory and try to use them, I get errors like
make: *** [obj/local/armeabi/libgame.so] Error 1
undefined reference to 'ConstAndStats::getDevice()'
How should I fix these problems, and add the already working codes (in Xcode) for my eclipse project?
Cocos Creator supports JavaScript, built in. Edit your Scenes and source code all from within. However, If you are a C++ or Lua developer, Cocos Creator allows exporting of Scenes to sour code for further development.
Cocos2D suits companies that decide to build games and interactive apps that are 2D, developed with the C++ programming language, JavaScript, C# and Lua, and can be played on both Android and iOS mobile technologies, as well as across all the main operating systems (Windows, Mac, Linux).
To download Cocos2d-x, go to http://www.Cocos2d-x.org/download and download Version 2.2. 3 from the website. Once downloaded, you can unzip the Cocos2d-x-2.2.
This kind of error may appear if you add a class to the classes directory but forget to add it to the Android.mk file from the jni folder. Add something like this:
LOCAL_SRC_FILES := hellocpp/main.cpp \
../../Classes/YourClass.cpp \
../../Classes/YourLastClass.cpp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With