Android port - SDL several errors

Hello folfks,

I’m porting a desktop game to android, following the LazyFoo tutorials. I think all is correctly configured, but I’m getting some compiler errors that compiles on windows.

Error 1 : ndk was not recogniziing SDL_Color - SOLVED

Summary

code

Here’s the compiler message:

error: expected expression mapPair_t(“white”, {255, 255, 255, 255}),

Solution: Changing SDL_image version to a newer one.


Error 2 : compiler error, IMG_WIC.c was not found - SOLVED
Solution: SDL_image 2.0.2 release didn’t have the file, so download the zip drom mercurial repo


Error 3 : compiler error - SOLVED

Error:(920) undefined reference to ‘INT123_frame_dither_init’

Solution: ad cpp flags to jni/src/Android.mk

LOCAL_CPPFLAGS += -std=c++14

Error 4 : nkd-build does not recognize an stl c++11 method (Current error)

no member named ‘shrink_to_fit’ in ‘std::vector<Collider *, std::allocator<Collider *> >’

-Thanks!-

PD: I will be updating the main post as I get over the errors with the solutions

My guess is that your compiler do not use c++11 as default. Just add -std=c++11 to compiler flags to fix this.
If that does not work, please specify which compiler you use, its version and its configuration.

Well It seems that I was building for the wrong android target :sweat_smile:

Then I’ve seen something strange, the release for SDL_image 2.0.2 does not have
IMG_WIC.c
so I had to go to mercurial repo and dowload that release.

After solving a similar problem with SDL_mixer now I get this with the last commit:
Error:(920) undefined reference to ‘INT123_frame_dither_init’

I don’t know if there’s any concrete set of versions for the libraries so I can compile the game to Android 7