ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

dyld: Library not loaded: QtWidgets

asked 2021-07-09 21:14:38 -0500

anonymous user

Anonymous

I ran run demo_nodes_cpp talker successfully but now I have troubles with this. I searched where QtWidgets is and it is at /usr/local/opt/qt/lib/QtWidgets.framework/Versions/A/QtWidgets

username@Ts-Mac ~ % ros2 run turtlesim turtlesim_node
dyld: Library not loaded: /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets
  Referenced from: /Users/username/Documents/ROS/ros2-osx/lib/turtlesim/turtlesim_node
  Reason: image not found

Would you tell me how to solve please?

I am using: MacBook Pro (13-inch, 2017, Four Thunderbolt 3 Ports)/ macOS Big Sur Version11.4/ ros2-foxy-20201211-macos-amd64.tar.bz2

edit retag flag offensive close merge delete

Comments

I am running into the same problem with ROS2 Foxy on macOS Monterrey. Did you find the solution?

wgrand gravatar image wgrand  ( 2021-12-28 14:06:46 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-12-29 06:40:44 -0500

updated 2021-12-29 07:01:23 -0500

Basically, you have to downgrade Qt to version 5 and change the references to the library to that version. To do that:

  1. Install Qt version 5:

    brew unlink qt
    brew install qt@5
    brew link --force qt@5

  2. Change the references to the Qt libraries within the turtlesim executable by doing the following:

    install_name_tool -change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets /usr/local/opt/qt@5/lib/QtWidgets.framework/Versions/5/QtWidgets /path/to/turtlesim_node

And repeat that command with by replacing QtWidgets with QtGui and QtCore. See the thread about this here: https://github.com/ros2/ros2/issues/1...

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-07-09 21:14:38 -0500

Seen: 741 times

Last updated: Dec 29 '21