PUTN catkin报错CMake Error 解决

在编译PUTN项目时出现如下报错

CMake Error at putn/src/putn/putn_rviz_plugins/CMakeLists.txt:46 (find_package):
  Could not find a configuration file for package "Qt5" that exactly matches
  requested version "5.9.5".

  The following configuration files were considered but not accepted:

    /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake, version: 5.11.3
    /home/test/Qt5.12.5/5.12.5/gcc_64/lib/cmake/Qt5/Qt5Config.cmake, version: 5.12.5

-- Configuring incomplete, errors occurred!
See also "/home/test/putn_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/test/putn_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

原因是找不到5.9.5版本的Qt。

解决办法:打开putn/src/putn/putn_rviz_plugins/CMakeLists.txt文件,找到这段

“find_package(Qt5 ${rviz_QT_VERSION} EXACT REQUIRED Core Widgets )
  ## make target_link_libraries(${QT_LIBRARIES}) pull in all required dependencies
  set(QT_LIBRARIES Qt5::Widgets)
endif()”删除其中的${rviz_QT_VERSION}将其改成


  find_package(Qt5 EXACT REQUIRED Core Widgets )
  ## make target_link_libraries(${QT_LIBRARIES}) pull in all required dependencies
  set(QT_LIBRARIES Qt5::Widgets)
endif()

保存重新编译

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值