W
W
wolf-98302014-02-27 14:41:47
Android
wolf-9830, 2014-02-27 14:41:47

How to make android project with additional SDL2_Image library?

The fact is that I managed to make an android project using SDL2 and Android SDK|NDK, but I can’t do it at all with the additional SDL2_Image library.
I wrote what I need in Android.mk and SDL_Activity.java, but the terminal gives the following error:

[email protected]:~/AndroidDevlopment/SDL_DEmo/jni$ '/home/good_inc/Doc/AndroidNDK/ndk-build' 
[armeabi] Install        : libSDL2.so => libs/armeabi/libSDL2.so
[armeabi] SharedLibrary  : libSDL2_image.so
/home/good_inc/Doc/AndroidNDK/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/good_inc/AndroidDevlopment/SDL_DEmo/obj/local/armeabi/objs/SDL2_image/IMG_webp.o: in function IMG_InitWEBP:/home/good_inc/AndroidDevlopment/SDL_DEmo/jni/SDL_Image/IMG_webp.c:123: error: undefined reference to 'WebPGetFeaturesInternal'
/home/good_inc/Doc/AndroidNDK/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/good_inc/AndroidDevlopment/SDL_DEmo/obj/local/armeabi/objs/SDL2_image/IMG_webp.o: in function IMG_InitWEBP:/home/good_inc/AndroidDevlopment/SDL_DEmo/jni/SDL_Image/IMG_webp.c:123: error: undefined reference to 'WebPDecodeRGBInto'
/home/good_inc/Doc/AndroidNDK/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/good_inc/AndroidDevlopment/SDL_DEmo/obj/local/armeabi/objs/SDL2_image/IMG_webp.o: in function IMG_InitWEBP:/home/good_inc/AndroidDevlopment/SDL_DEmo/jni/SDL_Image/IMG_webp.c:123: error: undefined reference to 'WebPDecodeRGBAInto'
collect2: ld returned 1 exit status
make: *** [/home/good_inc/AndroidDevlopment/SDL_DEmo/obj/local/armeabi/libSDL2_image.so] Error 1

How to fix?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2014-02-27
@wolf-9830

If WebP is not needed, then the easiest way is to change true to false in the SDL2_image/Android.mk file, in the line SUPPORT_WEBP := true
If needed, then either copy the SDL2_image/external/libwebp-0.3. including it from root Android.mk. I faced the same problem in SDL2_audio and didn't understand how to include it properly. I had to copy.

G
GavriKos, 2014-02-27
@GavriKos

Not all dependencies are included. Maybe, maybe the source. This is indicated by the absence of some functions, WebPDecodeRGBAInto for example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question