报错信息如下
-- Using Qt5 based on the rviz_QT_VERSION: 5.9.5
CMake Error at zed-ros-examples/rviz-plugin-zed-od/CMakeLists.txt:35 (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:
/home/yuanzebin/Qt5.14.2/5.14.2/gcc_64/lib/cmake/Qt5/Qt5Config.cmake, version: 5.14.2
-- Configuring incomplete, errors occurred!
See also "/home/yuanzebin/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/yuanzebin/catkin_ws/build/CMakeFiles/CMakeError.log".
报错截图如下
解决办法如下
修改CMakeLists.txt文件:如果项目可以使用高版本的Qt5(如5.14.2),你可以修改CMakeLists.txt
文件中的find_package(Qt5 5.9.5 REQUIRED)
行,将版本号改为安装的版本号5.14.2
或者去掉版本号要求(这取决于项目的兼容性)
修改内容如下
把第35行的find_package(Qt5 ${rviz_QT_VERSION} EXACT REQUIRED Core Widgets)
改为下面的内容
find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED) # 去掉具体
版本