问题
在创建qt-ros-ws工作空间时,
mkdir -p qt_ros_ws/src
cd qt_ros_ws/src
catkin_create_qt_pkg hello roscpp rospy std_msgs
cd ..
catkin_make
执行catkin_make
时,发现报错
Could NOT find qt_build (missing: qt_build_DIR)
-- Could not find the required component 'qt_build'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "qt_build" with any
of the following names:
qt_buildConfig.cmake
qt_build-config.cmake
Add the installation prefix of "qt_build" to CMAKE_PREFIX_PATH or set
"qt_build_DIR" to a directory containing one of the above files. If
"qt_build" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
hello/CMakeLists.txt:13 (find_package)
解决
我是Ubuntu16.04,kinetic版本号,安装
sudo apt-get install ros-kinetic-qt-ros
再次执行
catkin_make
执行成功,并测试
source devel/setup.bash
rosrun hello hello
成功运行