我有一个使用NDK的项目,它的CMakeLists.txt文件如下所示:
cmake_minimum_required(VERSION 3.4.1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror")
add_library( # Specifies the name of the library.
main
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
main.c)
target_link_libraries(
android
log
)
这里的it遵循googlesamples github存储库中列出的所有NDK示例项目的模式。我一直收到CMakeLists.txt(target_link_libraries)
的CMake错误,似乎大多数人都是通过添加以下行来解决的:
add_library(debug <files Name>)
但是没有人为日志添加这个功能。我做错了什么?