Using Qt Libraries with ROS Indigo CMake Error [closed]
I'm trying to incorporate an existing Qt GUI into a ROS node. I'm initially just trying to get the CMakeLists.txt to build successfully in QtCreator 2.7.2. I keep getting an error that:
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:75 (find_package):
Could not find a package configuration file provided by "Qt4" with any of
the following names:
Qt4Config.cmake
qt4-config.cmake
Add the installation prefix of "Qt4" to CMAKE_PREFIX_PATH or set "Qt4_DIR"
to a directory containing one of the above files. If "Qt4" provides a
separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
armswing_ros/CMakeLists.txt:7 (find_package)
There are a few possible solutions suggested that I've tried, and I haven't been able to get things to work correctly yet. I added Qt4 COMPONENTS QtCore QTGui
to the find_package()
call, usr/include/qt4
to the include_directories()
call, INCLUDE(${QT_USE_FILE}) ADD_DEFINITIONS(${QT_DEFINITIONS})
, and a link to my package "armswing_ros" in the target_link_libraries()
as such: armswing_ros ${QT_LIBRARIES}
.
What do I need to do to get the Qt libraries available?
Have you had any luck?
Not so far. I was gone the end of last week so I've just started looking again. I'm not getting errors that libraries can't be found anymore, but I still don't have access to the necessary Qt components: QString, QFile, and QTextStream
Could you update your question with the Ubuntu version and the output of
qmake --version
?I managed to get it to work. The GUI was written using Qt4 libraries, which I couldn't import, but I could import Qt5 libraries, so I did. Then there was a bit of adding Qt4 directories back in where names had been changed and now it builds successfully. Thanks a bunch!
Absolutely! So this question may be closed?