I’ve been trying to port a test app to Android for many hours. First i followed this guide, and succeed in a SDL only project. But then, I needed to port another simple program which uses SDL_image as well, and it was impossible. Then I used this other guide, but now the error seems to be from a NDK header file. I have a fresh installed NDK from the SDK manager of Android Studio (I’m using the GUI, but cmdline gradle doesn’t work neither).
This is my directory structure: pastebin(dot)com/33vbCyZr
This is my app/jni/src/Android.mk:
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := main SDL_PATH := ../SDL SDL_IMAGE_PATH := ../SDL_image SRC_PATH := ../../../../../ LOCAL_CPPFLAGS := -std=c++17 -frtti -O3 -DNDEBUG LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/$(SRC_PATH)/include \ $(LOCAL_PATH)/$(SDL_PATH)/include \ $(LOCAL_PATH)/$(SDL_IMAGE_PATH)/include \ LOCAL_SRC_FILES := \ $(wildcard $(SRC_PATH)/src/*.cpp) \ $(wildcard $(SRC_PATH)/src/*/*.cpp) \ $(wildcard $(SRC_PATH)/src/*/*/*.cpp) LOCAL_SHARED_LIBRARIES := SDL2 SDL2_image LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog include $(BUILD_SHARED_LIBRARY)
And this is the error that occurrs (I’ve checked I have the latest version of every library/tool):
In file included from /home/mxtappz/imagetest/imagetest/app/jni/SDL2_image/src/IMG.c:24: In file included from /home/mxtappz/imagetest/imagetest/app/jni/SDL2_image/include/SDL_image.h:32: In file included from /home/mxtappz/imagetest/imagetest/app/jni/SDL2_image/include/SDL.h:38: In file included from /home/mxtappz/imagetest/imagetest/app/jni/SDL2_image/include/SDL_cpuinfo.h:111: In file included from /home/mxtappz/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/9.0.9/include/immintrin.h:14: /home/mxtappz/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/9.0.9/include/mmintrin.h:50:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_vec_init_v2si(__i, 0); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
What can I do? Thanks in advanced.