tom@tom-virtual-machine:~/Documents/LTK_CPP_Linux_10_46_0/libltkcpp-linux/examples/docsample1/build$ cmake ..
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
LIBLTKCPP
linked by target "docsample1" in directory /home/tom/Documents/LTK_CPP_Linux_10_46_0/libltkcpp-linux/examples/docsample1
LIBLTKCPP_IMPINJ
linked by target "docsample1" in directory /home/tom/Documents/LTK_CPP_Linux_10_46_0/libltkcpp-linux/examples/docsample1
-- Configuring incomplete, errors occurred!
See also "/home/tom/Documents/LTK_CPP_Linux_10_46_0/libltkcpp-linux/examples/docsample1/build/CMakeFiles/CMakeOutputom@tom-virtual-machine:~/Documents/LTK_CPP_Linux_10_46_0/libltkcpp-linux/examples/docsample1/build$
上面的是报错结果。
cmake_minimum_required(VERSION 3.16)
project(docsample1)
find_library(LIBLTKCPP libltkcpp.a REQUIRED)
find_library(LIBLTKCPP_IMPINJ libltkcppimpinj.a REQUIRED)
# it is not recommended to statically link for ssl and crypto libraries
find_library(LIBSSL ssl REQUIRED)
find_library(LIBCRYPTO crypto REQUIRED)
# The ETK does not contain a host static library for xml2. Add the generic
# name 'xml2' to link against the dynmaic library when compiling for host.
find_library(LIBXML2 NAMES libxml2.a xml2 REQUIRED)
set(LIBS
${LIBLTKCPP}
${LIBLTKCPP_IMPINJ}
${LIBCRYPTO}
${LIBSSL}
${LIBXML2}
)
add_executable(${PROJECT_NAME} ${PROJECT_NAME}.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE ${LIBS})
这是cmakelists.txt文件。
请问出错的可能原因及解决方法是什么?