Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android lib.so缺失,并且没有已知的规则来创建它_Android_Cmake - Fatal编程技术网

Android lib.so缺失,并且没有已知的规则来创建它

Android lib.so缺失,并且没有已知的规则来创建它,android,cmake,Android,Cmake,从google示例中,我试图定制hello libs示例addind我的共享库libofr_engine_core 但是我收到这个错误 错误:“C:/Users/../Downloads/android ndk master/hello libs/distribution/ofr/lib/arm64-v8a/libofr_engine_core.so”是“C:/Users/../Downloads/android ndk master/hello libs/app/build/intermedi

从google示例中,我试图定制hello libs示例addind我的共享库libofr_engine_core

但是我收到这个错误

错误:“C:/Users/../Downloads/android ndk master/hello libs/distribution/ofr/lib/arm64-v8a/libofr_engine_core.so”是“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)

该错误明确表示为
libofr\u引擎\u核心
库(通过导入的位置属性)设置的路径不存在。该错误明确表示为
libofr\u引擎\u核心
库(通过导入的位置属性)设置的路径不存在。