0
$\begingroup$

Rosanswers logo

Hi,

I'm trying to release a package in Melodic (find_object_2d) that depends on qt_gui_cpp (in its package.xml). Normally, in previous distributions (Lunar, Kinetic, Indigo...), qt_gui_cpp will install qtbase5-dev indirectly (qtbase5-dev is in package.xml of qt_gui_cpp). Then find_object_2d build will be able to find Qt5. But in Melodic, the builds fail: http://build.ros.org/job/Mbin_uB64__find_object_2d__ubuntu_bionic_amd64__binary/ http://build.ros.org/job/Mbin_uA64__find_object_2d__ubuntu_artful_amd64__binary/ http://build.ros.org/job/Mbin_ubv8_uBv8__find_object_2d__ubuntu_bionic_arm64__binary/ http://build.ros.org/job/Mbin_ubhf_uBhf__find_object_2d__ubuntu_bionic_armhf__binary/

with this error:

12:21:57 CMake Error at /usr/share/cmake-3.10/Modules/FindQt4.cmake:1320 (message):
12:21:57   Found unsuitable Qt version "" from NOTFOUND, this code requires Qt 4.x
12:21:57 Call Stack (most recent call first):
12:21:57   CMakeLists.txt:47 (FIND_PACKAGE)

The error is about Qt4 because in find_object_2d's CMakeLists.txt, it searches for Qt5 first (optional), then if not found i searches for Qt4 (required):

# look for Qt5 before Qt4
FIND_PACKAGE(Qt5 COMPONENTS Widgets Core Gui Network QUIET)
IF(NOT Qt5_FOUND)
   FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtNetwork REQUIRED)
ENDIF(NOT Qt5_FOUND)

I can reproduce the error with melodic docker desktop (not full):

$ docker run -it osrf/ros:melodic-desktop-bionic
$ cd
$ mkdir catkin_ws
$ cd catkin_ws
$ mkdir src
$ cd src
$ catkin_init_workspace
$ git clone https://github.com/introlab/find-object.git
$ cd ..
$ catkin_make

The error above appears. To solve the problem, I should explicitly install qt5:

$ apt-get install qtbase5-dev
$ catkin_make

or

$ rosdep install qt_gui_cpp
$ catkin_make

The question is why qt_gui_cpp doesn't install qtbase5-dev? https://github.com/ros-visualization/qt_gui_core/blob/kinetic-devel/qt_gui_cpp/package.xml#L24

Original issue link: https://github.com/introlab/find-object/issues/52


Originally posted by matlabbe on ROS Answers with karma: 6409 on 2018-05-22

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

qt_gui_cpp only declares a build dependency on qtbase5-dev. That means the dependency is only being installed when that package is being built.

When you are using it to build your package only its run dependencies are installed (otherwise users of rqt would need all development packages on their system). As far as I can see nothing in that package has changed in the past - actually Kinetic is even using the exact same branch.

So I assume that you were lucky before that some other dependency brought in qtbase5-dev transitively and your package was relying on that behavior. If your package needs qtbase5-dev I recommend that you state that explicitly as a build dependency in the manifest. The "downside" will be that you can't easily switch between Qt 5 and Qt 4. That is the reason why qt_gui_cpp uses different branches for Indigo (targeting Qt 4) and Kinetic (targeting Qt 5).


Originally posted by Dirk Thomas with karma: 16276 on 2018-05-22

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.