Android NDK 中的 SDL_SetVideoMode
我即将使用 NDK 将已使用 SDL 库的现有游戏移植到 android,但调用此应用程序时应用程序崩溃(SDL_Init 运行正常,SetVideoMode 崩溃):
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_TIMER) < 0) {
screen = SDL_SetVideoMode(0, 0, 16, SDL_FULLSCREEN);
}
有什么想法吗?
ndk-gdb:
Android NDK installation path: /cygdrive/c/android-sdk-windows/android-ndk-r7/.
Using default adb command: /cygdrive/c/android-sdk-windows/platform-tools/adb
ADB version found: Android Debug Bridge version 1.0.29
Using final ADB command: '/cygdrive/c/android-sdk-windows/platform-tools/adb'
Using specified project path: C:/Users/Revan/workspace/JazzDroid
Found package name: com.dscorp.jazzdroid
ABIs targetted by application: armeabi
Device API Level: 10
Device CPU ABI: armeabi
Compatible device ABI: armeabi
Found debuggable flag: true
Found device gdbserver: /data/data/com.dscorp.jazzdroid/lib/gdbserver
Using gdb setup init: ./libs/armeabi/gdb.setup
Using toolchain prefix: /cygdrive/c/android-sdk-windows/android-ndk-r7/./toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-
Using app out directory: ./obj/local/armeabi
Found data directory: '/data/data/com.dscorp.jazzdroid'
Found first launchable activity: .SDLActivity
Launching activity: com.dscorp.jazzdroid/.SDLActivity
## COMMAND: /cygdrive/c/android-sdk-windows/platform-tools/adb shell am start -n com.dscorp.jazzdroid/.SDLActivity
Starting: Intent { cmp=com.dscorp.jazzdroid/.SDLActivity }
## COMMAND: /cygdrive/c/android-sdk-windows/platform-tools/adb shell sleep 2
Found running PID: 476
Launched gdbserver succesfully.
Setup network redirection
## COMMAND: /cygdrive/c/android-sdk-windows/platform-tools/adb forward tcp:5039 localfilesystem:/data/data/com.dscorp.jazzdroid/debug-socket
## COMMAND: /cygdrive/c/android-sdk-windows/platform-tools/adb shell run-as com.dscorp.jazzdroid lib/gdbserver +debug-socket --attach 476
## COMMAND: /cygdrive/c/android-sdk-windows/platform-tools/adb pull /system/bin/app_process obj/local/armeabi/app_process
Cannot attach to process 476: No such process (3)
345 KB/s (5660 bytes in 0.016s)
Pulled app_process from device/emulator.
## COMMAND: /cygdrive/c/android-sdk-windows/platform-tools/adb pull /system/lib/libc.so obj/local/armeabi/libc.so
58 KB/s (273868 bytes in 4.574s)
Pulled libc.so from device/emulator.
cp: cannot stat `./libs/armeabi/gdb.setup': No such file or directory
GNU gdb 6.6
Copyright (C) 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=i586-mingw32msvc --target=arm-elf-linux".
(no debugging symbols found)
(gdb) C:\android-sdk-windows\android-ndk-r7/obj/local/armeabi/gdb.setup:2: Error in sourced command file:
Remote communication error: Bad file descriptor.
I'm about to port a existing game that allready uses the SDL libary to android with the NDK, but the application crashs when calling this(SDL_Init runs fine, SetVideoMode crashes):
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_TIMER) < 0) {
screen = SDL_SetVideoMode(0, 0, 16, SDL_FULLSCREEN);
}
Any ideas?
ndk-gdb:
Android NDK installation path: /cygdrive/c/android-sdk-windows/android-ndk-r7/.
Using default adb command: /cygdrive/c/android-sdk-windows/platform-tools/adb
ADB version found: Android Debug Bridge version 1.0.29
Using final ADB command: '/cygdrive/c/android-sdk-windows/platform-tools/adb'
Using specified project path: C:/Users/Revan/workspace/JazzDroid
Found package name: com.dscorp.jazzdroid
ABIs targetted by application: armeabi
Device API Level: 10
Device CPU ABI: armeabi
Compatible device ABI: armeabi
Found debuggable flag: true
Found device gdbserver: /data/data/com.dscorp.jazzdroid/lib/gdbserver
Using gdb setup init: ./libs/armeabi/gdb.setup
Using toolchain prefix: /cygdrive/c/android-sdk-windows/android-ndk-r7/./toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-
Using app out directory: ./obj/local/armeabi
Found data directory: '/data/data/com.dscorp.jazzdroid'
Found first launchable activity: .SDLActivity
Launching activity: com.dscorp.jazzdroid/.SDLActivity
## COMMAND: /cygdrive/c/android-sdk-windows/platform-tools/adb shell am start -n com.dscorp.jazzdroid/.SDLActivity
Starting: Intent { cmp=com.dscorp.jazzdroid/.SDLActivity }
## COMMAND: /cygdrive/c/android-sdk-windows/platform-tools/adb shell sleep 2
Found running PID: 476
Launched gdbserver succesfully.
Setup network redirection
## COMMAND: /cygdrive/c/android-sdk-windows/platform-tools/adb forward tcp:5039 localfilesystem:/data/data/com.dscorp.jazzdroid/debug-socket
## COMMAND: /cygdrive/c/android-sdk-windows/platform-tools/adb shell run-as com.dscorp.jazzdroid lib/gdbserver +debug-socket --attach 476
## COMMAND: /cygdrive/c/android-sdk-windows/platform-tools/adb pull /system/bin/app_process obj/local/armeabi/app_process
Cannot attach to process 476: No such process (3)
345 KB/s (5660 bytes in 0.016s)
Pulled app_process from device/emulator.
## COMMAND: /cygdrive/c/android-sdk-windows/platform-tools/adb pull /system/lib/libc.so obj/local/armeabi/libc.so
58 KB/s (273868 bytes in 4.574s)
Pulled libc.so from device/emulator.
cp: cannot stat `./libs/armeabi/gdb.setup': No such file or directory
GNU gdb 6.6
Copyright (C) 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=i586-mingw32msvc --target=arm-elf-linux".
(no debugging symbols found)
(gdb) C:\android-sdk-windows\android-ndk-r7/obj/local/armeabi/gdb.setup:2: Error in sourced command file:
Remote communication error: Bad file descriptor.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论