it runs very well under Win32,but when using cygwin to build android version....

Dear all,

cocos2d-x’s demo is very excellent,but when i’m using it to do my small test………
is there any thing to set in someplace?it really runs well under win32 platform.

here is what the cygwin said:
——————————————————————————————————————————————————
SharedLibrary : libgame.so
E:/workspace_cpp/cocos2d-0.99.5-x-0.8.3/HelloCocos2d/android/obj/local/armeabi/objs-debug/game/…/…/…/Classes/HelloWorldScene.o: In function `HelloWorldScene::init()‘:
E:/workspace_cpp/cocos2d-0.99.5-x-0.8.3/HelloCocos2d/android/jni/helloworld/…/…/…/Classes/HelloWorldScene.cpp:119: undefined reference to `HelloCocos2dSprite::spriteWithFile(bool, char const**)’
E:/workspace_cpp/cocos2d-0.99.5-x-0.8.3/HelloCocos2d/android/jni/helloworld/…/…/…/Classes/HelloWorldScene.cpp:120: undefined reference to `HelloCocos2dSprite::logicInit’
E:/workspace_cpp/cocos2d-0.99.5-x-0.8.3/HelloCocos2d/android/jni/helloworld/…/…/…/Classes/HelloWorldScene.cpp:144: undefined reference to `HelloCocos2dSprite::spriteWithFile’
E:/workspace_cpp/cocos2d-0.99.5-x-0.8.3/HelloCocos2d/android/jni/helloworld/…/…/…/Classes/HelloWorldScene.cpp:145: undefined reference to `HelloCocos2dSprite::logicInit’
E:/workspace_cpp/cocos2d-0.99.5-x-0.8.3/HelloCocos2d/android/obj/local/armeabi/objs-debug/game/…/…/…/Classes/HelloWorldScene.o: In function `HelloWorldScene::update’:
E:/workspace_cpp/cocos2d-0.99.5-x-0.8.3/HelloCocos2d/android/jni/helloworld/…/…/…/Classes/HelloWorldScene.cpp:268: undefined reference to `HelloCocos2dSprite::logicUpdate’
E:/workspace_cpp/cocos2d-0.99.5-x-0.8.3/HelloCocos2d/android/jni/helloworld/…/…/…/Classes/HelloWorldScene.cpp:277: undefined reference to `HelloCocos2dSprite::getUnitSpeedX’
E:/workspace_cpp/cocos2d-0.99.5-x-0.8.3/HelloCocos2d/android/jni/helloworld/…/…/…/Classes/HelloWorldScene.cpp:277: undefined reference to `HelloCocos2dSprite::getUnitSpeedY’
E:/workspace_cpp/cocos2d-0.99.5-x-0.8.3/HelloCocos2d/android/jni/helloworld/…/…/…/Classes/HelloWorldScene.cpp:288: undefined reference to `HelloCocos2dSprite::logicUpdate’
collect2: ld returned 1 exit status
make:**** [/cygdrive/e/workspace_cpp/cocos2d-0.99.5-x-0.8.3/HelloCocos2d/android/obj/local/armeabi/libgame.so] Error 1
make: Leaving directory `/cygdrive/e/workspace_cpp/cocos2d-0.99.5-x-0.8.3/HelloCocos2d/android’

and here is another 2 resource file:
map.jpg ——you can use any image bigger than the screen size;
edward.png ——just copy & paste the icon file;

is the problem in my code?it’s my first project in cocos2d-x……


Classes.rar.zip (8.4 KB)

If it runs ok on windows, I think the classes are not problem.
May be you don’t add the new .cpp to HelloWorld/android/jni/helloworld/Android.mk.

oh yeah,Thank you Minggo Zhang, I Love you![](:stuck_out_tongue:

you’re right, i did not modify Android.mk, I should add all .cpp file to it;).


now I can build the project using cygwin, success)
then,using eclipse to create helloCocos2d.apk automatically,
installation is very successful,
but when I click this application on my phone(moto xt502), it returned to homescreen…….

…headache……

06-01 16:20:51.191: INFO/DEBUG(10179): ** ** ** ** ** ** ** **
06-01 16:20:51.191: INFO/DEBUG(10179): [Time]: 2011/06/01 Wed 16:20:51
06-01 16:20:51.191: INFO/DEBUG(10179): Build fingerprint: ‘Motorola/XT502/XT502/XT502:2.1-update1/ERE27/2_25D_5013:user/release-keys’
06-01 16:20:51.201: INFO/DEBUG(10179): pid: 10320, tid: 10329 >>> org.cocos2dx.application <<< thread name: Thread-10
06-01 16:20:51.201: INFO/DEBUG(10179): signal 4 (SIGILL), fault addr 6fe3c3f4
06-01 16:20:51.201: INFO/DEBUG(10179): r0 002862e8 r1 35d7ca58 r2 002862e8 r3 00145220
06-01 16:20:51.201: INFO/DEBUG(10179): r4 0027e388 r5 0027e8e8 r6 1119003c r7 2db4df54
06-01 16:20:51.201: INFO/DEBUG(10179): r8 35d7cd70 r9 2db4df4c 10 2db4df38 fp 35d7cd90
06-01 16:20:51.201: INFO/DEBUG(10179): ip 6d00f178 sp 35d7ca40 lr 2ddff39c pc 6fe3c3f4 cpsr 00000010
06-01 16:20:51.241: INFO/DEBUG(10179): #00 pc 6fe3c3f4
06-01 16:20:51.241: INFO/DEBUG(10179): #01 lr 2ddff39c /dalvik-LinearAlloc (deleted)
06-01 16:20:51.241: INFO/DEBUG(10179): code around lr:
06-01 16:20:51.241: INFO/DEBUG(10179): 2ddff38c 00000000 6d03a071 00000000 00000000
06-01 16:20:51.241: INFO/DEBUG(10179): 2ddff39c 325b3ed8 0000010a 00020000 00020000
06-01 16:20:51.241: INFO/DEBUG(10179): 2ddff3ac 2db4587a 0013a728 0000002f 2db44f1c
06-01 16:20:51.241: INFO/DEBUG(10179): stack:
06-01 16:20:51.241: INFO/DEBUG(10179): 35d7ca00 35d7ca80
06-01 16:20:51.241: INFO/DEBUG(10179): 35d7ca04 35d7ca94
06-01 16:20:51.241: INFO/DEBUG(10179): 35d7ca08 0027eb40 [heap]
06-01 16:20:51.241: INFO/DEBUG(10179): 35d7ca0c 1108ea35 /data/data/org.cocos2dx.application/lib/libcocos2d.so
06-01 16:20:51.241: INFO/DEBUG(10179): 35d7ca10 0027eb40 [heap]
06-01 16:20:51.241: INFO/DEBUG(10179): 35d7ca14 35d7ca80
06-01 16:20:51.241: INFO/DEBUG(10179): 35d7ca18 0027e8e8 [heap]
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca1c 1108e6ff /data/data/org.cocos2dx.application/lib/libcocos2d.so
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca20 2db4df54
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca24 35d7ca80
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca28 2db4df4c
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca2c 110fd773 /data/data/org.cocos2dx.application/lib/libcocos2d.so
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca30 00143a88 [heap]
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca34 35d7ca80
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca38 df002777
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca3c e3a070ad
06-01 16:20:51.251: INFO/DEBUG(10179): #00 35d7ca40 35d7cb6c
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca44 35d7cb0c
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca48 002862e8 [heap]
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca4c 0027e8d8 [heap]
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca50 35d7cb73
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca54 0027eb70 [heap]
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca58 35d7cb01
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca5c 0027eb70 [heap]
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca60 35d7ca01
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca64 2e70616d /system/framework/framework.odex
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca68 0067706a
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca6c 35d7cb0c
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca70 35d7cb3c
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca74 35d7ca6b
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca78 35d7ca64
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca7c 002862e8 [heap]
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca80 2e70616d /system/framework/framework.odex
06-01 16:20:51.251: INFO/DEBUG(10179): 35d7ca84 0067706a
06-01 16:20:51.301: DEBUG/PowerManagerService(1261): lightSensorChangedLocked 5
06-01 16:20:51.301: DEBUG/PowerManagerService(1261): old mLightSensorBrightness: 51
06-01 16:20:51.301: DEBUG/PowerManagerService(1261): lcdValue 51
06-01 16:20:51.691: INFO/WindowManager(1261): WIN DEATH: Window{3283c878 SurfaceView paused=false}
06-01 16:20:51.691: DEBUG/KeyguardViewMediator(1261): setHidden false
06-01 16:20:51.701: INFO/ActivityManager(1261): Process org.cocos2dx.application (pid 10320) has died.
06-01 16:20:51.701: DEBUG/KeyguardViewMediator(1261): setHidden false
06-01 16:20:51.701: DEBUG/KeyguardViewMediator(1261): setHidden false
06-01 16:20:51.701: VERBOSE/RenderScript_jni(1351): surfaceCreated
06-01 16:20:51.701: VERBOSE/RenderScript_jni(1351): surfaceChanged
06-01 16:20:51.701: INFO/WindowManager(1261): WIN DEATH: Window{3283c4d8 org.cocos2dx.application/org.cocos2dx.application.HelloCocos2d paused=false}
06-01 16:20:51.711: DEBUG/KeyguardViewMediator(1261): setHidden false
06-01 16:20:51.711: INFO/UsageStats(1261): Unexpected resume of com.android.launcher2 while already resumed in org.cocos2dx.application

the project configuration is uploaded, would you please have a look? please…

Your configuration is ok.
Have you ever runned HelloWorld without modification on the real phone?

yes,I build hellowWorld, and tests.
both project runs perfectly on my phone:)

Oh, it seems that, the logic of your code is error.
The most possible is that, the sources are not loaded correctly.
You should debug it.

ok, i’ll try it.
thank you Minggo.:wink:

if there is any progress, i’ll post it here.:slight_smile:

ok,the bug is …

the map size is 1056 * 632,and the max support size maybe 1024 * 1024,anyway some devcie or some standard is this.

finally thank you Minggo,

for this great tool cocos2d-x:D

Cool.
I think you should adjust the map size.