litecdows 2021-08-03 15:44 采纳率: 0%
浏览 1036
已结题

关于cmakelists.txt文件编译出现notfound错误的解决办法?

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文件。

 

请问出错的可能原因及解决方法是什么?

  • 写回答

1条回答 默认 最新

  • 有问必答小助手 2021-08-04 13:51
    关注

    你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答

    本次提问扣除的有问必答次数,已经为您补发到账户,我们后续会持续优化,扩大我们的服务范围,为您带来更好地服务。

    评论

报告相同问题?

问题事件

  • 系统已结题 8月11日
  • 创建了问题 8月3日

悬赏问题

  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作