Closed Duron27 closed 4 months ago
I had to drop to version 2.24.0 for a project, is there a flag or workaround for this? for context this is how I'm using it https://gitlab.com/cavebros/openmw-android-docker/-/blob/Testing/Dockerfile#L255 and here is the ndk-build version that works https://gitlab.com/cavebros/openmw-android-docker/-/blob/main/Dockerfile?ref_type=heads#L255
and here is the file that gives the lld errors https://gitlab.com/cavebros/openmw-android-docker/-/blob/main/patches/openmw/android_main.cpp?ref_type=heads
Android_Window
is an internal SDL_Window, which is not supposed to be visible outside of the SDL2 library.
I cannot build any example using Android_Window
when linked to a shared SDL2/3 library, but when I disable this "shield" (-DHAVE_GCC_FVISIBILITY=OFF
), the internal symbols become visible again.
The better solution is of course to not let your design depend on SDL internals.
yea building with -latomic
-no-canonical-prefixes -Wl,--gc-sections -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--no-undefined -Wl,--fatal-warnings -Wl,--no-undefined-version -ldl -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid -ldl -lc -lm` solved it for me
I wish I could but I don't have the skill to update the code atm
extern SDL_Window Android_Window; extern "C" int SDL_SendMouseMotion(SDL_Window window, int mouseID, int relative, int x, int y); extern "C" void Java_org_libsdl_app_SDLActivity_sendRelativeMouseMotion(JNIEnv *env, jclass cls, int x, int y) { SDL_SendMouseMotion(Android_Window, 0, 1, x, y);
Upstream OpenMW also uses SDL internals. https://gitlab.com/OpenMW/openmw/-/blob/master/apps/openmw/android_main.cpp?ref_type=heads#L41
I suggest raising an issue there to re-implement this using the public SDL api.
building for android with cmake vs ndk-build gives
ld.lld: error: undefined symbol: SDL_SendMouseButton ld.lld: error: undefined symbol: Android_Window
when I compile my app also the libSDL2.so file is about 200 kbs smaller which is strange