Open lt3stus3el opened 2 years ago
same result in windows! missing some libraries?
Compiled with following CMakeLists.txt:
# Sets the minimum version of CMake required to build the native library.
cmake_minimum_required(VERSION 3.4.1)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/)
add_compile_options(-fno-rtti -O3 -v)
message(@@@${CMAKE_CURRENT_SOURCE_DIR})
link_directories(binder_libs/${CMAKE_ANDROID_ARCH_ABI})
aux_source_directory(. SRC_LIST) # 搜索当前目录下的所有.cpp文件
add_library( # Sets the name of the library.
keep_alive
# Sets the library as a shared library.
STATIC
# 提供源文件的相对路径。
${SRC_LIST} main.cpp art.cpp)
set_target_properties(keep_alive PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/binder_libs/${ANDROID_ABI}/libutils.so)
set_target_properties(keep_alive PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/binder_libs/${ANDROID_ABI}/libc.so)
set_target_properties(keep_alive PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/binder_libs/${ANDROID_ABI}/libcutils.so)
set_target_properties(keep_alive PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/binder_libs/${ANDROID_ABI}/libutils.so)
find_library(log-lib log)
target_link_libraries(
keep_alive
${log-lib}
)
@lt3stus3el still missing java.lang.UnsatisfiedLinkError: dlopen failed: library "libkeep_alive.so" not found
Cloned and compiled with NDK 24.0.8215888 in linux. error log: