我想加一個第三方庫,CMakelist 是這樣寫的:
cmake_minimum_required(VERSION 3.4.1)
add_library(
# Sets the name of the library.
native-lib
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
src/main/cpp/native-lib.cpp)
find_library(
log-lib
log)
add_library( test
SHARED
IMPORTED)
set_target_properties(test
PROPERTIES IMPORTED_LOCATION
$(CMAKE_SOURCE_DIR)/src/main/jniLibs/$(CMAKE_ANDROID_ARCH_ABI)/libtest.so)
target_link_libraries( # Specifies the target library.
native-lib
test
# Links the target library to the log library
# included in the NDK.
${log-lib})
一直報錯
CMake Error at CMakeLists.txt:43 (set_target_properties):
-- Configuring incomplete, errors occurred!
請問我到底錯哪了啊?
uj5u.com熱心網友回復:
43 行就是 set_target_properties 那行,我轉過來的時候把注釋刪了uj5u.com熱心網友回復:
set_target_properties(xhook PROPERTIES IMPORTED_LOCATION $(CMAKE_SOURCE_DIR)/src/main/jniLibs/$(CMAKE_ANDROID_ARCH_ABI)/libxhook.so)
寫到一行來就好了...ljas
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/75619.html
標籤:Android
