Игры здесь
Вторник, 16.07.2024, 21:44

Приветствую Вас Гость | RSS
[ Главная ] [ Developing Cocos2d-x project for Android in MOTODEV v3.1 - Форум ] [ Регистрация ] [ Вход ]
[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]
  • Страница 1 из 1
  • 1
Developing Cocos2d-x project for Android in MOTODEV v3.1
DoubleVenomДата: Четверг, 23.02.2012, 16:25 | Сообщение # 1
Группа: Администраторы
Сообщений: 12
Репутация: 0
Статус: Offline
Cocos2dx v1.0.1-x-0.11 downloaded from here:
Motodev Studio for Android 3.1 downloaded from here:

I can't make automatic includes! It must allways be manual with this tools! What have I done wrong? (debbuggind works well)
DoubleVenomДата: Четверг, 23.02.2012, 16:25 | Сообщение # 2
Группа: Администраторы
Сообщений: 12
Репутация: 0
Статус: Offline
This is my steps:
Cocos2dxSimpleGame downloaded from:
Note: target sdk version of project should be set not less, than 9. Minimal can be not less, than 7.
1. Extract Cocos2dxSimpleGame (which one? - with "android" folder inside) in cocos2d-x folder, as usual to almost all projects for cocos2d-x.
2. Copy all *.h & *.cpp from Classes to android/jni/helloworld
3. Adjust android/build_native.sh
so that paths there are set to real cocos2dx and NDK. Also make sure, that path to cpp-source is set to where you copied it in step 2 (android/jni/helloworld)
4. Run build_native.sh. It will take long. It must have no errors.
5. If it has no errors => create new Android project in Eclipse, based on source code from "android" folder
6. Run project. (it builds before run).
7. If it runs, convert project to C/C++
8. Open up Android.xml and set android:debuggable="true". If necessary, add line before <application> tag:
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="10"/>
Use your values for sdk versions, of course.
9. Go to project properties->C/C++/Build. Set auto build.
9. Click project->clean. Build must run automatically.
DoubleVenomДата: Четверг, 23.02.2012, 16:26 | Сообщение # 3
Группа: Администраторы
Сообщений: 12
Репутация: 0
Статус: Offline
10. [optional] If build is not started and you have "Error: Program "ndk-build" is not found in PATH" in console window of Eclipse, where path looks like: PATH=[/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games] and you really knows that your path is ok, you can open project properties->C/C++ Build/Environment and edit path by yourself.
Open up terminal, write:
echo $PATH
Then copy string to Eclipse. Save. Now there will be build process, if not click manually project->Build. It should be ok.
11. Click onto green bug to debug your project.
12. Now, while application is running, open console, go to:
<PATH TO COCOS2DX_ROOT>/<PROJECT NAME>/android directory and run ndk-gdb, for ex:
cd ~/opt/cocos2dx/Cocos2dxSimpleGame/android
It must see smth like:
GNU gdb 6.6
Copyright © 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=x86_64-linux-gnu --target=arm-elf-linux".
(no debugging symbols found)
Error while mapping shared library sections:
/system/bin/linker: No such file or directory.
Error while mapping shared library sections:
libstdc++.so: No such file or directory.
Error while mapping shared library sections:
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
warning: shared library handler failed to enable breakpoint
0xafd0c5ac in epoll_wait ()
from /home/iz/opt/cocos2dx/Cocos2dxSimpleGame/android/obj/local/armeabi/libc.so
13. Type
and then
to quit gdb and return to the command prompt.
14. Go to
<PATH TO COCOS2DX_ROOT>/<PROJECT NAME>/android/obj/local/armeabi
and create a copy of gdb.setup named gdb2.setup.
Open gdb2.setup and remove the command:
target remote :5039
15. In Eclipse click debug->debug configurations... Select "C++ application" and click "Create new". New debug configuration appears.
16. Click "Create Process Launcher - select other". A window will pop up. Mark the Use configuration specific settings checkbox and then select Standard Create Process Launcher option.
17. In the Name field enter whatever text you wish - this name you will use to run debug.
18. Click in the Browse button near Project: field in the Main tab and select Cocos2dxSimpleGame project.
19. The field C/C++ Application: in Main tab needs to be filled with full path to app_process file: <PATH TO COCOS2DX_ROOT>/<PROJECT NAME>/android/obj/local/armeabi/app_process
20. Uncheck "select configuration using C/C++..." and set "Build configuration" as "Use Active".
21. Check "Enable auto build".
22. Click apply.
23. Click in the Debugger tab. In the Debugger: combobox select gdbserver
24. In the GDB Debugger: you need to insert the full path to gdb binary provided by Android NDK:
25. In the GDB Command File: you must insert the full path to file gdb2.setup:
<PATH TO COCOS2DX_ROOT>/<PROJECT NAME>/android/obj/local/armeabi/gdb2.setup
26. Mark the Verbose console mode checkbox.
27. Check "Stop on startup at" and fill textbox with name of your main function (ussually, in android/jni/helloworld/main.cpp):
27. Still in the Debugger Tab click in Connection.
Select TCP as Type.
Set Port Number to 5039.
Set host name or IP: localhost.
Click in the Apply and Close buttons.
  • Страница 1 из 1
  • 1

Михаил, 2024      Создать бесплатный сайт с uCoz