I apt installed ros2 on ubuntu 20.04 and worked just fine however I need to install opencv 4.2.0 which caused removing all ros2 installation.
So I need to build install ros2 as described in the document here https://docs.ros.org/en/foxy/Installation/Ubuntu-Development-Setup.html
I followed every step in the process and when trying to colcon build, the process stuck at qt_gui_core as below
$ colcon build --symlink-install
Starting >>> ament_pyflakes
--- stderr: qt_gui_cpp
g++: error: unrecognized command line option ‘-ffile-prefix-map=/build/sip4-IM_1PV/sip4-4.19.21+dfsg=.’
make[3]: *** [Makefile:18: siplibqt_gui_cpp_sipcmodule.o] Error 1
make[2]: *** [src/qt_gui_cpp_sip/CMakeFiles/libqt_gui_cpp_sip.dir/build.make:61: src/qt_gui_cpp_sip/libqt_gui_cpp_sip.so] Error 2
make[1]: *** [CMakeFiles/Makefile2:237: src/qt_gui_cpp_sip/CMakeFiles/libqt_gui_cpp_sip.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed <<< qt_gui_cpp [18.1s, exited with code 2]
Aborted <<< ament_pyflakes [14.5s]
Aborted <<< rosidl_typesupport_fastrtps_cpp [1min 42s]
Aborted <<< rviz_rendering [4min 25s]
Summary: 120 packages finished [6min 38s]
1 package failed: qt_gui_cpp
3 packages aborted: ament_pyflakes rosidl_typesupport_fastrtps_cpp rviz_rendering
2 packages had stderr output: qt_gui_cpp rviz_rendering
187 packages not processed
When tried to build just qt_gui_cpp
$ colcon build --symlink-install --packages-select qt_gui_cpp
Starting >>> qt_gui_cpp
--- stderr: qt_gui_cpp
g++: error: unrecognized command line option ‘-ffile-prefix-map=/build/sip4-IM_1PV/sip4-4.19.21+dfsg=.’
g++: error: unrecognized command line option ‘-ffile-prefix-map=/build/sip4-IM_1PV/sip4-4.19.21+dfsg=.’
make[3]: *** [Makefile:18: siplibqt_gui_cpp_sipcmodule.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [Makefile:18: siplibqt_gui_cpp_sipQList0101qt_gui_cppPluginDescriptor.o] Error 1
g++: error: unrecognized command line option ‘-ffile-prefix-map=/build/sip4-IM_1PV/sip4-4.19.21+dfsg=.’
make[3]: *** [Makefile:18: siplibqt_gui_cpp_sipQList0101qt_gui_cppPluginProvider.o] Error 1
g++: error: unrecognized command line option ‘-ffile-prefix-map=/build/sip4-IM_1PV/sip4-4.19.21+dfsg=.’
make[3]: *** [Makefile:18: siplibqt_gui_cpp_sipQMap0100QString0100QString.o] Error 1
make[2]: *** [src/qt_gui_cpp_sip/CMakeFiles/libqt_gui_cpp_sip.dir/build.make:61: src/qt_gui_cpp_sip/libqt_gui_cpp_sip.so] Error 2
make[1]: *** [CMakeFiles/Makefile2:237: src/qt_gui_cpp_sip/CMakeFiles/libqt_gui_cpp_sip.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed <<< qt_gui_cpp [0.97s, exited with code 2]
Summary: 0 packages finished [5.74s]
1 package failed: qt_gui_cpp
1 package had stderr output: qt_gui_cpp
I double checked the process with my own laptop running Ubuntu 20.04
Also followed same instruction and all build ok.
There was some warnings while building qt_gui_cpp as below
--- stderr: qt_gui_cpp
qt.shiboken: (typesystem) Unable to locate Clang's built-in include directory (neither by checking the environment variables LLVM_INSTALL_DIR, CLANG_INSTALL_DIR nor running llvm-config). This may lead to parse errors.
(typesystem) clang_parseTranslationUnit2(0x0, cmd[25]=-fPIC -Wno-constant-logical-operand -std=c++14 -I/home/khyou/ros2_foxy/src/ros-visualization/qt_gui_core/qt_gui_cpp/include -I/home/khyou/ros2_foxy/install/pluginlib/include -I/home/khyou/ros2_foxy/install/class_loader/include -I/home/khyou/ros2_foxy/install/rcpputils/include -I/home/khyou/ros2_foxy/install/rcutils/include -I/home/khyou/ros2_foxy/install/ament_index_cpp/include -I/opt/ros/foxy/include -I/usr/include -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -I/usr/include/PySide2 -I/usr/include/c++/9 -I/usr/include/x86_64-linux-gnu/c++/9 -I/usr/include/c++/9/backward -I/usr/lib/gcc/x86_64-linux-gnu/9/include -I/usr/local/include -I/usr/include/x86_64-linux-gnu -I/usr/include /tmp/global_cvWrCy.hpp)
qt.shiboken: (typesystem) Enum 'RCUTILS_LOG_SEVERITY' does not have a type entry
qt.shiboken: (typesystem) While traversing QOpenGLShaderProgram: setAttributeArray(int,const float*,int,int): Cannot use parameter 2 as an array: <array> modification already applied.
qt.shiboken: (typesystem) class 'QAccessibleWidget' inherits from unknown base class 'QAccessibleActionInterface'
qt.shiboken: (typesystem) class not found for setup inheritance 'QAccessibleActionInterface'
---
Finished <<< qt_gui_cpp [52.1s]
However it all build ok
Starting >>> rviz2
Finished <<< rviz2 [7.08s]
Summary: 311 packages finished [12min 9s]
7 packages had stderr output: mimick_vendor qt_gui_cpp rmw_connext_cpp rmw_connext_shared_cpp ros1_bridge rosidl_typesupport_connext_c rosidl_typesupport_connext_cpp
Any help or suggestion would be much appreciated.
Originally posted by kyubot on ROS Answers with karma: 60 on 2022-04-30
Post score: 1