Mr.Smile填坑记——AndroidStudio创建C++ NDK支持报错CMake Error: The following variables are used in this project

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
-- Configuring incomplete, errors occurred!
Please set them or make sure they are set and tested correctly in the CMake files:
See also "E:/asProject/TestC/app/.externalNativeBuild/cmake/release/x86_64/CMakeFiles/CMakeOutput.log".
log-lib
linked by target "native-lib" in directory E:/asProject/TestC/app
See also "E:/asProject/TestC/app/.externalNativeBuild/cmake/release/x86_64/CMakeFiles/CMakeError.log".
什么鬼?我就创建个项目就直接报错了?AS还行不行啊?一万个草泥马奔腾而过!!!
于是Google了一下,发现一个很类似的,但是环境不一样
原文链接https://stackoverflow.com/questions/10717798/cmake-error-the-following-variables-are-used-in-this-project-but-they-are-set
参考上文发现大概意思就是 log-lib 找不到了,但是"native-lib"又用到它了
上面说下载安装就好了,可是人家的库是三方库,这个log-lib是自带的啊,我上哪下载,又一万个草泥马奔腾而过!!!

又经过一系列探索发现了这个文件CMakeLists.txt

find_library( # Sets the name of the path variable.
              log-lib
              # Specifies the name of the NDK library that
              # you want CMake to locate.
              log )

target_link_libraries( # Specifies the target library.
                       native-lib
                       # Links the target library to the log library
                       # included in the NDK.
                       ${log-lib} )
						)
将含有log-lib的代码注释掉就好了,哪位大神有更好的办法,请不吝赐教!


你可能感兴趣的:(填坑)