I have included the headers for the required .so libraries at the top of my code, but when I run ndk-build, I'm still getting errors like this:
- Code: Select all
/home/paul/workspace/mycore/obj/local/armeabi-v7a/objs-debug/core/src/api/vidext.o: In function `VidExt_Init':
/home/paul/workspace/mycore/jni/core/src/api/vidext.c:89: undefined reference to `SDL_InitSubSystem'
/home/paul/workspace/mycore/jni/core/src/api/vidext.c:91: undefined reference to `SDL_GetError'
/home/paul/workspace/mycore/obj/local/armeabi-v7a/objs-debug/core/src/api/vidext.o: In function `VidExt_Quit':
/home/paul/workspace/mycore/jni/core/src/api/vidext.c:112: undefined reference to `SDL_WasInit'
/home/paul/workspace/mycore/jni/core/src/api/vidext.c:115: undefined reference to `SDL_ShowCursor'
/home/paul/workspace/mycore/jni/core/src/api/vidext.c:116: undefined reference to `SDL_QuitSubSystem'
The obvious reason is because those references are in the header files as "externs", while their actual implementations are in the .C files which have been compiled separately into the .so library I'm trying to link with. For example in SDL.h:
- Code: Select all
/** This function initializes specific SDL subsystems */
extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
/** This function cleans up specific SDL subsystems */
extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
(where the actual implementations of SDL_InitSubSystem and SDL_QuitSubSystem are in SDL.c)
So how do I tell the compiler "Hey, you know those extern functions I told you about? They are implemented inside the .so library, so quit looking for them in the .C files, OK?"
I've tried adding the following to my Android.mk, but no luck:
- Code: Select all
LOCAL_SHARED_LIBRARIES := sdl-1.2 sdl_main sdl_mixer sdl_image
- Code: Select all
LOCAL_LDLIBS += -L/home/paul/workspace/mupen64plus/project/obj/local/armeabi/libsdl-1.2.so \
-L/home/paul/workspace/mupen64plus/project/obj/local/armeabi/libsdl_main.so \
-L/home/paul/workspace/mupen64plus/project/obj/local/armeabi/libsdl_mixer.so \
-L/home/paul/workspace/mupen64plus/project/obj/local/armeabi/libsdl_image.so
Anything obvious I'm missing here? Thanks in advance for the help!


