1:I use android-ndk-r7 complie shared library on ubuntu linux.
2:download cocos2d-1.0.1-x-0.10.0.zip
3:unzip package to android-ndk-r7/samples/
4:and input command:
cd android-ndk-r7/samples/cocos2d/cocos2dx
vi Android.mk
change: #122
LOCAL_CFLAGS := DUSE_FILE32APIDGL_GLEXT_PROTOTYPES=1
cd android-ndk-r7/samples/cocos2d/HelloWorld/android
/usr/local/src/android-ndk-r7/ndk-build
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi-v7a/gdbserver
Gdbsetup : libs/armeabi-v7a/gdb.setup
Install : libcocos2d.so => libs/armeabi/libcocos2d.so
Install : libcocosdenshion.so => libs/armeabi/libcocosdenshion.so
Install : libgame_logic.so => libs/armeabi/libgame_logic.so
Install : libhelloworld.so => libs/armeabi/libhelloworld.so
Install : libcocos2d.so => libs/armeabi-v7a/libcocos2d.so
Install : libcocosdenshion.so => libs/armeabi-v7a/libcocosdenshion.so
Install : libgame_logic.so => libs/armeabi-v7a/libgame_logic.so
Install : libhelloworld.so => libs/armeabi-v7a/libhelloworld.so
5:copy android-ndk-r7/samples/cocos2d/HelloWorld/android to window XP and create a new project
6:run it,crash
11-15 00:19:02.194: D/AndroidRuntime(5451): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
11-15 00:19:02.194: D/AndroidRuntime(5451): CheckJNI is ON
11-15 00:19:03.187: D/AndroidRuntime(5451): — registering native functions —
11-15 00:19:03.515: D/ddm-heap(5451): Got feature list request
11-15 00:19:04.145: D/AndroidRuntime(5451): Shutting down VM
11-15 00:19:04.145: D/dalvikvm(5451): DestroyJavaVM waiting for non-daemon threads to exit
11-15 00:19:04.145: D/dalvikvm(5451): DestroyJavaVM shutting VM down
11-15 00:19:04.154: D/dalvikvm(5451): HeapWorker thread shutting down
11-15 00:19:04.154: D/dalvikvm(5451): HeapWorker thread has shut down
11-15 00:19:04.154: D/jdwp(5451): JDWP shutting down net…
11-15 00:19:04.154: I/dalvikvm(5451): Debugger has detached; object registry had 1 entries
11-15 00:19:04.171: E/AndroidRuntime(5451): ERROR: thread attach failed
11-15 00:19:04.185: D/dalvikvm(5451): VM cleaning up
11-15 00:19:04.194: D/dalvikvm(5451): LinearAlloc 0x0 used 613956 of 5242880 (11)
11-15 00:19:31.525: D/AndroidRuntime(5460): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
11-15 00:19:31.535: D/AndroidRuntime(5460): CheckJNI is ON
11-15 00:19:31.674: D/AndroidRuntime(5460): — registering native functions —
11-15 00:19:31.905: D/ddm-heap(5460): Got feature list request
11-15 00:19:32.745: D/PackageParser(64): Scanning package: /data/app/vmdl39265.tmp
11-15 00:19:34.224: I/PackageManager(64): /data/app/vmdl39265.tmp changed; unpacking
11-15 00:19:34.235: D/PackageManager(64): Caching shared lib lib/armeabi/libcocos2d.so
11-15 00:19:34.815: D/PackageManager(64): Caching shared lib lib/armeabi/libcocosdenshion.so
11-15 00:19:34.825: D/PackageManager(64): Caching shared lib lib/armeabi/libgame_logic.so
11-15 00:19:34.855: D/PackageManager(64): Caching shared lib lib/armeabi/libhelloworld.so
11-15 00:19:34.875: D/installd(32): DexInv: — BEGIN ‘/data/app/vmdl39265.tmp’ —
11-15 00:19:35.141: I/ActivityManager(64): Process com.android.settings (pid 5432) has died.
11-15 00:19:35.304: D/dalvikvm(5466): DexOpt: load 57ms, verify 90ms, opt 2ms
11-15 00:19:35.334: D/installd(32): DexInv: — END ‘/data/app/vmdl39265.tmp’ (success) —
11-15 00:19:35.415: I/installd(32): move /data/dalvik-cache/data@app@vmdl39265.tmp@classes.dex -> /data/dalvik-cache/data@app@org.cocos2dx.application.apk@classes.dex
11-15 00:19:35.426: D/PackageManager(64): New package installed in /data/app/org.cocos2dx.application.apk
11-15 00:19:35.535: D/AndroidRuntime(5460): Shutting down VM
11-15 00:19:35.544: D/dalvikvm(5460): DestroyJavaVM waiting for non-daemon threads to exit
11-15 00:19:35.554: D/dalvikvm(5460): DestroyJavaVM shutting VM down
11-15 00:19:35.554: D/dalvikvm(5460): HeapWorker thread shutting down
11-15 00:19:35.554: D/dalvikvm(5460): HeapWorker thread has shut down
11-15 00:19:35.554: D/jdwp(5460): JDWP shutting down net…
11-15 00:19:35.554: I/dalvikvm(5460): Debugger has detached; object registry had 1 entries
11-15 00:19:35.566: D/dalvikvm(5460): VM cleaning up
11-15 00:19:35.594: D/dalvikvm(5460): LinearAlloc 0x0 used 623916 of 5242880 (11)
11-15 00:19:35.605: E/AndroidRuntime(5460): ERROR: thread attach failed
11-15 00:19:36.054: D/dalvikvm(64): GC freed 8954 objects / 578968 bytes in 293ms
11-15 00:19:36.134: W/ResourceType(64): Resources don’t contain package for resource number 0x7f0700e5
11-15 00:19:36.145: W/ResourceType(64): Resources don’t contain package for resource number 0x7f020031
11-15 00:19:36.145: W/ResourceType(64): Resources don’t contain package for resource number 0x7f020030
11-15 00:19:36.145: W/ResourceType(64): Resources don’t contain package for resource number 0x7f050000
11-15 00:19:36.206: W/ResourceType(64): Resources don’t contain package for resource number 0x7f060000
11-15 00:19:36.214: I/ActivityManager(64): Start proc com.svox.pico for broadcast com.svox.pico/.VoiceDataInstallerReceiver: pid=5472 uid=10012 gids={}
11-15 00:19:36.334: W/ResourceType(64): Resources don’t contain package for resource number 0x7f060001
11-15 00:19:36.594: D/ddm-heap(5472): Got feature list request
11-15 00:19:36.895: D/AndroidRuntime(5471): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
11-15 00:19:36.895: D/AndroidRuntime(5471): CheckJNI is ON
11-15 00:19:37.065: D/AndroidRuntime(5471): — registering native functions —
11-15 00:19:37.344: D/ddm-heap(5471): Got feature list request
11-15 00:19:37.655: I/ActivityManager(64): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=org.cocos2dx.application/.ApplicationDemo }
11-15 00:19:37.716: D/AndroidRuntime(5471): Shutting down VM
11-15 00:19:37.716: D/dalvikvm(5471): DestroyJavaVM waiting for non-daemon threads to exit
11-15 00:19:37.716: D/dalvikvm(5471): DestroyJavaVM shutting VM down
11-15 00:19:37.716: D/dalvikvm(5471): HeapWorker thread shutting down
11-15 00:19:37.716: D/dalvikvm(5471): HeapWorker thread has shut down
11-15 00:19:37.725: D/jdwp(5471): JDWP shutting down net…
11-15 00:19:37.725: I/dalvikvm(5471): Debugger has detached; object registry had 1 entries
11-15 00:19:37.745: D/dalvikvm(5471): VM cleaning up
11-15 00:19:37.754: E/AndroidRuntime(5471): ERROR: thread attach failed
11-15 00:19:37.765: D/dalvikvm(5471): LinearAlloc 0x0 used 639500 of 5242880 (12%)
11-15 00:19:37.775: I/ActivityManager(64): Start proc org.cocos2dx.application for activity org.cocos2dx.application/.ApplicationDemo: pid=5483 uid=10032 gids={}
11-15 00:19:37.935: D/ddm-heap(5483): Got feature list request
11-15 00:19:37.985: I/WindowManager(64): Setting rotation to 1, animFlags=0
11-15 00:19:38.025: I/ActivityManager(64): Config changed: { scale=1.0 imsi=310/260 loc=zh_CN touch=3 keys=2/1/2 nav=3/1 orien=2 layout=18}
11-15 00:19:38.235: D/dalvikvm(5483): Trying to load lib /data/data/org.cocos2dx.application/lib/libcocos2d.so 0x44dacb68
11-15 00:19:38.435: D/dalvikvm(5483): Added shared lib /data/data/org.cocos2dx.application/lib/libcocos2d.so 0x44dacb68
11-15 00:19:38.445: D/dalvikvm(5483): Trying to load lib /data/data/org.cocos2dx.application/lib/libcocosdenshion.so 0x44dacb68
11-15 00:19:38.445: D/dalvikvm(5483): Added shared lib /data/data/org.cocos2dx.application/lib/libcocosdenshion.so 0x44dacb68
11-15 00:19:38.445: D/dalvikvm(5483): Trying to load lib /data/data/org.cocos2dx.application/lib/libgame_logic.so 0x44dacb68
11-15 00:19:38.456: D/dalvikvm(5483): Added shared lib /data/data/org.cocos2dx.application/lib/libgame_logic.so 0x44dacb68
11-15 00:19:38.456: D/dalvikvm(5483): No JNI_OnLoad found in /data/data/org.cocos2dx.application/lib/libgame_logic.so 0x44dacb68
11-15 00:19:38.465: D/dalvikvm(5483): Trying to load lib /data/data/org.cocos2dx.application/lib/libhelloworld.so 0x44dacb68
11-15 00:19:38.465: D/dalvikvm(5483): Added shared lib /data/data/org.cocos2dx.application/lib/libhelloworld.so 0x44dacb68
11-15 00:19:38.465: D/dalvikvm(5483): No JNI_OnLoad found in /data/data/org.cocos2dx.application/lib/libhelloworld.so 0x44dacb68
11-15 00:19:38.495: D/qemud(35): fdhandler_accept_event: accepting on fd 10
11-15 00:19:38.495: D/qemud(35): created client 0x184ba8 listening on fd 15
11-15 00:19:38.495: D/qemud(35): client_fd_receive: attempting registration for service ‘sensors’
11-15 00:19:38.506: D/qemud(35): client_fd_receive: -> received channel id 19
11-15 00:19:38.525: D/qemud(35): client_registration: registration succeeded for client 19
11-15 00:19:38.544: D/SensorManager(5483): found sensor: Goldfish 3-axis Accelerometer, handle=0
11-15 00:19:38.544: D/qemud(35): fdhandler_event: disconnect on fd 15
11-15 00:19:38.565: D/dalvikvm(5483): Trying to load lib /system/lib/libsoundpool.so 0x0
11-15 00:19:38.624: D/dalvikvm(5483): Added shared lib /system/lib/libsoundpool.so 0x0
11-15 00:19:38.649: W/apk path(5483): /data/app/org.cocos2dx.application.apk
11-15 00:19:38.649: D/dalvikvm(5483): + not scanning ‘/system/lib/libwebcore.so’ for ‘nativeSetPaths’
11-15 00:19:38.649: D/dalvikvm:+ not scanning ‘/system/lib/libexif.so’ for ‘nativeSetPaths’ (wrong CL)
11-15 00:19:38.655: D/dalvikvm(5483): + not scanning ‘/system/lib/libmedia_jni.so’ for ‘nativeSetPaths’
11-15 00:19:38.655: D/dalvikvm:+ not scanning ‘/system/lib/libsoundpool.so’ for ‘nativeSetPaths’ (wrong CL)
11-15 00:19:38.655: D/dalvikvm(5483): + not scanning ‘/system/lib/libsrec_jni.so’ for ‘nativeSetPaths’
11-15 00:19:38.706: D/dalvikvm:+ not scanning ‘/system/lib/libwebcore.so’ for ‘nativeOnResume’ (wrong CL)
11-15 00:19:38.714: D/dalvikvm(5483): + not scanning ‘/system/lib/libexif.so’ for ‘nativeOnResume’
11-15 00:19:38.714: D/dalvikvm:+ not scanning ‘/system/lib/libmedia_jni.so’ for ‘nativeOnResume’ (wrong CL)
11-15 00:19:38.714: D/dalvikvm(5483): + not scanning ‘/system/lib/libsoundpool.so’ for ‘nativeOnResume’
11-15 00:19:38.714: D/dalvikvm:+ not scanning ‘/system/lib/libsrec_jni.so’ for ‘nativeOnResume’ (wrong CL)
11-15 00:19:39.004: W/IInputConnectionWrapper(144): showStatusIcon on inactive InputConnection
11-15 00:19:39.084: D/libEGL(5483): egl.cfg not found, using default config
11-15 00:19:39.084: D/libEGL(5483): loaded /system/lib/egl/libGLES_android.so
11-15 00:19:39.115: D/dalvikvm(5483): + not scanning ‘/system/lib/libwebcore.so’ for ‘nativeInit’
11-15 00:19:39.115: D/dalvikvm:+ not scanning ‘/system/lib/libexif.so’ for ‘nativeInit’ (wrong CL)
11-15 00:19:39.115: D/dalvikvm(5483): + not scanning ‘/system/lib/libmedia_jni.so’ for ‘nativeInit’
11-15 00:19:39.155: D/dalvikvm:+ not scanning ‘/system/lib/libwebcore.so’ for ‘nativeInitBitmapDC’ (wrong CL)
11-15 00:19:39.155: D/dalvikvm(5483): + not scanning ‘/system/lib/libexif.so’ for ‘nativeInitBitmapDC’
11-15 00:19:39.155: D/dalvikvm:+ not scanning ‘/system/lib/libmedia_jni.so’ for ‘nativeInitBitmapDC’ (wrong CL)
11-15 00:19:39.167: D/dalvikvm(5483): + not scanning ‘/system/lib/libsoundpool.so’ for ‘nativeInitBitmapDC’
11-15 00:19:39.167: D/dalvikvm:+ not scanning ‘/system/lib/libsrec_jni.so’ for ‘nativeInitBitmapDC’ (wrong CL)
11-15 00:19:39.387: I/DEBUG(28): ** ** ** ** ** ** ** **
11-15 00:19:39.387: I/DEBUG(28): Build fingerprint: ‘generic/sdk/generic/:2.1-update1/ECLAIR/35983:eng/test-keys’
11-15 00:19:39.387: I/DEBUG(28): pid: 5483, tid: 5492 >>> org.cocos2dx.application <<<
11-15 00:19:39.387: I/DEBUG(28): signal 11 (SIGSEGV), fault addr deadbaad
11-15 00:19:39.387: I/DEBUG(28): r0 00000000 r1 afe1331d r2 00000027 r3 00000000
11-15 00:19:39.387: I/DEBUG(28): r4 00000000 r5 deadbaad r6 00002ed8 r7 42f32f54
11-15 00:19:39.387: I/DEBUG(28): r8 46ce5d58 r9 42f32f4c 10 42f32f38 fp 00136ed0
11-15 00:19:39.387: I/DEBUG(28): ip ffffffff sp 46ce5b78 lr afe142dd pc afe10c48 cpsr 40000030
11-15 00:19:39.686: I/DEBUG(28): #00 pc 00010c48 /system/lib/libc.so
11-15 00:19:39.695: I/DEBUG(28): #01 pc 000176ce /system/lib/libc.so
11-15 00:19:39.695: I/DEBUG(28): code around pc:
11-15 00:19:39.695: I/DEBUG(28): afe10c38 4e17d003 51a02001 4d164798 24002227
11-15 00:19:39.695: I/DEBUG(28): afe10c48 f7fb702a 2106ee6a ef1ef7fc 05592380
11-15 00:19:39.708: I/DEBUG(28): afe10c58 6091aa01 1c116054 94012006 eb0cf7fc
11-15 00:19:39.708: I/DEBUG(28): code around lr:
11-15 00:19:39.708: I/DEBUG(28): afe142cc 220ce008 2b005eab 1c28d003 47889901
11-15 00:19:39.708: I/DEBUG(28): afe142dc 35544306 d5f43f01 2c006824 b003d1ee
11-15 00:19:39.708: I/DEBUG(28): afe142ec bdf01c30 00024b44 000000b4 1c0fb5f0
11-15 00:19:39.708: I/DEBUG(28): stack:
11-15 00:19:39.708: I/DEBUG(28): 46ce5b38 00000015
11-15 00:19:39.716: I/DEBUG(28): 46ce5b3c afe1334d /system/lib/libc.so
11-15 00:19:39.716: I/DEBUG(28): 46ce5b40 afe3902c /system/lib/libc.so
11-15 00:19:39.716: I/DEBUG(28): 46ce5b44 afe38fd8 /system/lib/libc.so
11-15 00:19:39.725: I/DEBUG(28): 46ce5b48 00000000
11-15 00:19:39.725: I/DEBUG(28): 46ce5b4c afe142dd /system/lib/libc.so
11-15 00:19:39.725: I/DEBUG(28): 46ce5b50 afe3bb74
11-15 00:19:39.725: I/DEBUG(28): 46ce5b54 afe1331d /system/lib/libc.so
11-15 00:19:39.725: I/DEBUG(28): 46ce5b58 00000000
11-15 00:19:39.725: I/DEBUG(28): 46ce5b5c afe38e08 /system/lib/libc.so
11-15 00:19:39.725: I/DEBUG(28): 46ce5b60 00000000
11-15 00:19:39.725: I/DEBUG(28): 46ce5b64 00002ed8
11-15 00:19:39.725: I/DEBUG(28): 46ce5b68 42f32f54
11-15 00:19:39.725: I/DEBUG(28): 46ce5b6c afe135bb /system/lib/libc.so
11-15 00:19:39.725: I/DEBUG(28): 46ce5b70 df002777
11-15 00:19:39.725: I/DEBUG(28): 46ce5b74 e3a070ad
11-15 00:19:39.735: I/DEBUG(28): #00 46ce5b78 00000003
11-15 00:19:39.735: I/DEBUG(28): 46ce5b7c afe38e08 /system/lib/libc.so
11-15 00:19:39.735: I/DEBUG(28): 46ce5b80 80b904f0 /data/data/org.cocos2dx.application/lib/libcocos2d.so
11-15 00:19:39.735: I/DEBUG(28): 46ce5b84 000001f5
11-15 00:19:39.735: I/DEBUG(28): 46ce5b88 42f32f54
11-15 00:19:39.735: I/DEBUG(28): 46ce5b8c fffffbdf
11-15 00:19:39.735: I/DEBUG(28): 46ce5b90 afe38e08 /system/lib/libc.so
11-15 00:19:39.735: I/DEBUG(28): 46ce5b94 80b904f0 /data/data/org.cocos2dx.application/lib/libcocos2d.so
11-15 00:19:39.735: I/DEBUG(28): 46ce5b98 000001f5
11-15 00:19:39.735: I/DEBUG(28): 46ce5b9c afe176d3 /system/lib/libc.so
11-15 00:19:39.735: I/DEBUG(28): #01 46ce5ba0 afe38e08 /system/lib/libc.so
11-15 00:19:39.735: I/DEBUG(28): 46ce5ba4 afe176d3 /system/lib/libc.so
11-15 00:19:39.735: I/DEBUG(28): 46ce5ba8 000001f5
11-15 00:19:39.735: I/DEBUG(28): 46ce5bac 80b906e8 /data/data/org.cocos2dx.application/lib/libcocos2d.so
11-15 00:19:39.735: I/DEBUG(28): 46ce5bb0 00000000
11-15 00:19:39.735: I/DEBUG(28): 46ce5bb4 00000000
11-15 00:19:39.735: I/DEBUG(28): 46ce5bb8 00000148
11-15 00:19:39.735: I/DEBUG(28): 46ce5bbc 80ae887d /data/data/org.cocos2dx.application/lib/libcocos2d.so
11-15 00:19:39.735: I/DEBUG(28): 46ce5bc0 00000000
11-15 00:19:39.735: I/DEBUG(28): 46ce5bc4 00000000
11-15 00:19:39.735: I/DEBUG(28): 46ce5bc8 00000000
11-15 00:19:39.745: I/DEBUG(28): 46ce5bcc 00139c50 [heap]
11-15 00:19:39.745: I/DEBUG(28): 46ce5bd0 80bc9780 /data/data/org.cocos2dx.application/lib/libcocos2d.so
11-15 00:19:39.745: I/DEBUG(28): 46ce5bd4 00000000
11-15 00:19:39.745: I/DEBUG(28): 46ce5bd8 00000000
11-15 00:19:39.745: I/DEBUG(28): 46ce5bdc 80ae8d59 /data/data/org.cocos2dx.application/lib/libcocos2d.so
11-15 00:19:39.745: I/DEBUG(28): 46ce5be0 000bac10 [heap]
11-15 00:19:39.745: I/DEBUG(28): 46ce5be4 00000148
11-15 00:19:40.515: D/Zygote(30): Process 5483 terminated by signal (11)
11-15 00:19:40.525: I/WindowManager(64): WIN DEATH: Window{44dffe08 SurfaceView paused=false}
11-15 00:19:40.525: I/WindowManager(64): WIN DEATH: Window{44d14a38 org.cocos2dx.application/org.cocos2dx.application.ApplicationDemo paused=false}
11-15 00:19:40.552: I/ActivityManager(64): Process org.cocos2dx.application (pid 5483) has died.
11-15 00:19:40.745: D/dalvikvm(64): GC freed 4095 objects / 214000 bytes in 164ms
11-15 00:19:40.745: I/WindowManager(64): Setting rotation to 0, animFlags=0
11-15 00:19:40.827: W/WindowManager(64): Rebuild removed 3 windows but added 2
11-15 00:19:40.915: I/ActivityManager(64): Config changed: { scale=1.0 imsi=310/260 loc=zh_CN touch=3 keys=2/1/2 nav=3/1 orien=1 layout=18}
11-15 00:19:40.956: I/UsageStats(64): Unexpected resume of com.android.launcher while already resumed in org.cocos2dx.application
11-15 00:19:41.075: W/InputManagerService(64): Got RemoteException sending setActive(false) notification to pid 5483 uid 10032
11-15 00:19:43.344: D/dalvikvm(64): GC freed 1426 objects / 72744 bytes in 95ms
11-15 00:20:24.734: D/dalvikvm(118): GC freed 11930 objects / 524320 bytes in 253ms
any one can help me?
cocos2d.PNG (58.7 KB)