Ali Habiban
Ali Habiban

Reputation: 11

Qt include files in mamba environment conflict with the system Qt installation on Mac OS for ROS2 Humble

I am trying to build mapviz package for ROS2 Humble on Mac OS under mamba environment. The installation of ROS2 is based on Robostack. I keep getting the following errors:

CMake Warning at CMakeLists.txt:167 (add_executable):
  Cannot generate a safe runtime search path for target mapviz because files
  in some directories may conflict with libraries in implicit directories:

    runtime library [libboost_date_time.dylib] in /Users/username/miniforge3/envs/ros_env/lib may be hidden by files in:
      /opt/homebrew/lib
    runtime library [libboost_system.dylib] in /Users/username/miniforge3/envs/ros_env/lib may be hidden by files in:
      /opt/homebrew/lib
    runtime library [libboost_filesystem.dylib] in /Users/username/miniforge3/envs/ros_env/lib may be hidden by files in:
      /opt/homebrew/lib
    runtime library [libproj.dylib] in /Users/username/miniforge3/envs/ros_env/lib may be hidden by files in:
      /opt/homebrew/lib
    runtime library [libyaml.dylib] in /Users/username/miniforge3/envs/ros_env/lib may be hidden by files in:
      /opt/homebrew/lib
    runtime library [libboost_atomic.dylib] in /Users/username/miniforge3/envs/ros_env/lib may be hidden by files in:
      /opt/homebrew/lib

  Some of these libraries may not be found correctly.


In file included from /Users/username/ros2_ws/src/mapviz/mapviz/src/mapviz_main.cpp:30:
In file included from /Users/username/ros2_ws/src/mapviz/mapviz/include/mapviz/mapviz.hpp:36:
In file included from /Users/username/miniforge3/envs/ros_env/include/qt/QtWidgets/QMenu:1:
/Users/username/miniforge3/envs/ros_env/include/qt/QtWidgets/qmenu.h:238:31: error: non-virtual member function marked 'override' hides virtual member function
  238 |     void enterEvent(QEvent *) override;
      |                               ^
/opt/homebrew/include/QtWidgets/qwidget.h:673:18: note: hidden overloaded virtual function 'QWidget::enterEvent' declared here: type mismatch at 1st parameter ('QEnterEvent *' vs 'QEvent *')
  673 |     virtual void enterEvent(QEnterEvent *event);
      |                  ^
In file included from /Users/username/ros2_ws/src/mapviz/mapviz/src/mapviz_main.cpp:30:
In file included from /Users/username/ros2_ws/src/mapviz/mapviz/include/mapviz/mapviz.hpp:36:
In file included from /Users/username/miniforge3/envs/ros_env/include/qt/QtWidgets/QMenu:1:
/Users/username/miniforge3/envs/ros_env/include/qt/QtWidgets/qmenu.h:275:8: error: an attribute list cannot appear here
  275 | inline QT_DEPRECATED void qt_mac_set_dock_menu(QMenu *menu) { menu->setAsDockMenu(); }
      |        ^~~~~~~~~~~~~
/opt/homebrew/include/QtCore/qtdeprecationmarkers.h:25:25: note: expanded from macro 'QT_DEPRECATED'
   25 | #  define QT_DEPRECATED Q_DECL_DEPRECATED
      |                         ^~~~~~~~~~~~~~~~~
/opt/homebrew/include/QtCore/qcompilerdetection.h:999:29: note: expanded from macro 'Q_DECL_DEPRECATED'
  999 | #  define Q_DECL_DEPRECATED [[deprecated]]
      |                             ^~~~~~~~~~~~~~

As you can see include files of Qt are mixed between /opt/homebrew/include/ and /Users/username/miniforge3/envs/ros_env/include. Any idea how to fix this?

I tried setting the specific Qt path in CMakeLists.txt by set(Qt5_DIR /Users/username/miniforge3/envs/ros_env/include/qt/) but it did not work. I also tried exporting CMAKE_PREFIX_PATH with export CMAKE_PREFIX_PATH=$CONDA_PREFIX:$CMAKE_PREFIX_PATH, it did not work either.

Upvotes: 1

Views: 15

Answers (0)

Related Questions