I made a mistake compiling .so and .a libs.
That is why i got those undefined reference errors.
Android.mk
Code: Select all
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libslikenet
FILE_LIST := $(wildcard $(LOCAL_PATH)/../../Source/src/*.cpp)
FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Source/src/crypto/*.cpp)
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Source
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../Source/include
include $(BUILD_STATIC_LIBRARY)
Application.mk
Code: Select all
APP_STL := c++_static
APP_ABI := armeabi-v7a
APP_PLATFORM := android-9
So i tried Again:
NDK-r16b | APP_PLATFORM := android-24:
NDK-r16b | APP_PLATFORM := android-16:
[armeabi-v7a] Compile++ thumb: slikenet <= FileList.cpp
jni/../../Source/src/FileList.cpp:23:10: fatal error: 'asm/io.h' file not found
#include <asm/io.h>
^~~~~~~~~~
1 error generated.
make: *** [obj/local/armeabi-v7a/objs/slikenet/__/__/Source/src/FileList.o] Error 1
NDK-r10e | APP_PLATFORM := android-9:
NDK-r10e | APP_PLATFORM := android-16:
NDK-r10e | APP_PLATFORM := android-19:
[armeabi-v7a] Compile++ thumb: slikenet <= RakNetSocket2.cpp
In file included from jni/../../Source/src/RakNetSocket2.cpp:49:0:
jni/../../Source/src/RakNetSocket2_Windows_Linux.cpp:25:48: fatal error: ifaddrs.h: No such file or directory
#include <ifaddrs.h> // used for getifaddrs()
^
compilation terminated.
make.exe: *** [obj/local/armeabi-v7a/objs/slikenet/__/__/Source/src/RakNetSocket2.o] Error 1
NDK-r10e | APP_PLATFORM := android-21:
[armeabi-v7a] Compile++ thumb: slikenet <= FileList.cpp
jni/../../Source/src/FileList.cpp:23:20: fatal error: asm/io.h: No such file or directory
#include <asm/io.h>
^
compilation terminated.
make.exe: *** [obj/local/armeabi-v7a/objs/slikenet/__/__/Source/src/FileList.o] Error 1
I write this post just to make it clearer, but are the same errors when trying to compile the source code directly in the project.
I'd read that ifaddrs.h was added to android in API 24, so i wonder how it works in that pull using api level 9?
