lib.so缺失,没有已知的规则来实现它

时间:2017-06-11 16:11:18

标签: android cmake

从google示例我尝试自定义hello-libs示例addind my shared library libofr_engine_core

但我收到此错误......

错误:错误:' C:/ Users /.../ Downloads / android-ndk-master / hello-libs / distribution / ofr / lib / arm64-v8a / libofr_engine_core.so',需要by' C:/ Users /.../ Downloads / android-ndk-master / hello-libs / app / build / intermediates / cmake / debug / obj / arm64-v8a / libhello-libs.so' ,缺失和没有已知规则来实现它

我做错了什么?

显然我已将.so和.h添加到我的分发文件夹

cmake_minimum_required(VERSION 3.4.1)

# configure import libs
set(distribution_DIR ${CMAKE_SOURCE_DIR}/../../../../distribution)

add_library(lib_gmath STATIC IMPORTED)
set_target_properties(lib_gmath PROPERTIES IMPORTED_LOCATION
    ${distribution_DIR}/gmath/lib/${ANDROID_ABI}/libgmath.a)

# shared lib will also be tucked into APK and sent to target
# refer to app/build.gradle, jniLibs section for that purpose.
# ${ANDROID_ABI} is handy for our purpose here. Probably this ${ANDROID_ABI} is
# the most valuable thing of this sample, the rest are pretty much normal cmake
add_library(lib_gperf SHARED IMPORTED)
set_target_properties(lib_gperf PROPERTIES IMPORTED_LOCATION
    ${distribution_DIR}/gperf/lib/${ANDROID_ABI}/libgperf.so)


add_library(libofr_engine_core SHARED IMPORTED)
set_target_properties(libofr_engine_core PROPERTIES IMPORTED_LOCATION
    ${distribution_DIR}/ofr/lib/${ANDROID_ABI}/libofr_engine_core.so)



# build application's shared lib
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")

add_library(hello-libs SHARED
            hello-libs.cpp)

target_include_directories(hello-libs PRIVATE
                           ${distribution_DIR}/gmath/include
                           ${distribution_DIR}/gperf/include
                           ${distribution_DIR}/ofr/include
                           )

target_link_libraries(hello-libs
                      android
                      lib_gmath
                      lib_gperf
                      libofr_engine_core
                      log)

0 个答案:

没有答案