| Summary: | Android port doesn't compile (ndk-build error) | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Ellie <etc0de> |
| Component: | *don't know* | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED INVALID | QA Contact: | Sam Lantinga <slouken> |
| Severity: | blocker | ||
| Priority: | P2 | CC: | philipp.wiesemann |
| Version: | HG 2.0 | ||
| Hardware: | ARM | ||
| OS: | Android (All) | ||
I tried the temporary fix: cat blitwizard-android/jni/SDL/include/SDL_stdinc.h | sed -e "s/\#if defined[(]HAVE_ICONV[)]/\#if defined(ANDROID) || defined(__ANDROID__)\n\#undef HAVE_ICONV\n\#undef HAVE_ICONV_H\n\#endif\n\#if defined(HAVE_ICONV)/g" > blitwizard-android/jni/SDL/include/SDL_stdinc2.h cp blitwizard-android/jni/SDL/include/SDL_stdinc2.h blitwizard-android/jni/SDL/include/SDL_stdinc.h However, now I get: Compile thumb : SDL <= SDL_error.c Compile thumb : SDL <= SDL_log.c Compile thumb : SDL <= SDL_assert.c Compile thumb : SDL <= SDL_hints.c Compile thumb : SDL <= SDL_compat.c In file included from jni/SDL/src/SDL_compat.c:26: jni/SDL/include/SDL_syswm.h:68:22: error: X11/Xlib.h: No such file or directory jni/SDL/include/SDL_syswm.h:69:23: error: X11/Xatom.h: No such file or directory In file included from jni/SDL/src/SDL_compat.c:26: jni/SDL/include/SDL_syswm.h:130: error: expected specifier-qualifier-list before 'XEvent' jni/SDL/include/SDL_syswm.h:176: error: expected specifier-qualifier-list before 'Display' make: *** [obj/local/armeabi/objs/SDL/src/SDL_compat.o] Error 1 NDK build failed. Failed to complete Android build. bash-4.2$ X-Server on Android? Really? Somehow SDL seems to think it compiles for a Linux system. Would be nice if someone could give me a hand on what I'm doing wrong or on how to fix this, since I would love to do an Android port of my engine :-) Seems like something with the config headers is grossly wrong to me. Now is it my mistake, or is this simply so untested/old that some bigger mistake slipped in? (I followed README.android) Well it seems my SDL_config.h claims there is iconv and all that. But since ./configure isn't run, how exactly is my SDL_config.h supposed to be written in an Android-suitable way? Should I edit it myself? README.android doesn't mention anything in regards of that. Ok I am supposed to copy SDL_config_android.h obviously. I filed #1405 to reflect the total lack of any hint on this step in the README.android, and will close this bug: It was just a result of me missing that step in the build process, therefore not an actual issue in SDL itself, but rather with the documentation/readme. For me compiling works with just including SDL_config.h because this file includes SDL_config_android.h itself. This is since a change in the repository from 2012-01-03. Maybe your files were outdated (your post being from 2012-01-29) so you got the old behaviour. |
I just tried to port my Lua game engine based on SDL 1.3 to Android. Unfortunately, I ran into this error instead when running ndk-build V=1: rm -f ./libs/x86/lib*.so ./libs/armeabi/lib*.so ./libs/armeabi-v7a/lib*.so rm -f ./libs/x86/gdbserver ./libs/armeabi/gdbserver ./libs/armeabi-v7a/gdbserver rm -f ./libs/x86/gdb.setup ./libs/armeabi/gdb.setup ./libs/armeabi-v7a/gdb.setup Compile thumb : SDL <= SDL_error.c /home/jonas/d/androidsdk/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc -MMD -MP -MF ./obj/local/armeabi/objs/SDL/src/SDL_error.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -Ijni/SDL/include -I/home/jonas/d/androidsdk/android-ndk-r7/sources/cxx-stl/system/include -Ijni/SDL -DANDROID -Wa,--noexecstack -O2 -DNDEBUG -g -I/home/jonas/d/androidsdk/android-ndk-r7/platforms/android-5/arch-arm/usr/include -c jni/SDL/src/SDL_error.c -o ./obj/local/armeabi/objs/SDL/src/SDL_error.o In file included from jni/SDL/include/SDL_log.h:40, from jni/SDL/src/SDL_error.c:25: jni/SDL/include/SDL_stdinc.h:78:20: error: iconv.h: No such file or directory In file included from jni/SDL/include/SDL_log.h:40, from jni/SDL/src/SDL_error.c:25: jni/SDL/include/SDL_stdinc.h:739: error: expected ')' before 'cd' make: *** [obj/local/armeabi/objs/SDL/src/SDL_error.o] Error 1