Ask Your Question

ROS2 galactic demo node can't start

asked 2021-06-01 14:24:54 -0500

Gates gravatar image

I have installed ROS2 Galactic by following the tutorial on a fresh Ubuntu 20.04. Unfortunately, I cannot run the very first demo node ros2 run demo_nodes_cpp talker. I get such an error:

error while loading shared libraries: cannot open shared object file: No such file or directory

When I check if libfmt-dev is installed, I have it.

apt-cache policy libfmt-dev 
  Installed: 6.1.2+ds-2
  Candidate: 6.1.2+ds-2
  Version table:
 *** 6.1.2+ds-2 500
        500 focal/universe amd64 Packages
        100 /var/lib/dpkg/status

I don't understand what the issue is. When I try to debug as in here, I can get 'Hello World!'.

I also tried to install using debian packages as in this tutorial. I get a completely different error then:

source /opt/ros/galactic/setup.bash 
user:~$ ros2 run demo_nodes_cpp talker
terminate called after throwing an instance of 'rclcpp::exceptions::RCLError'
  what():  failed to initialize rcl init options: failed to load shared library '' due to dlopen error: cannot open shared object file: No such file or directory, at /tmp/binarydeb/ros-galactic-rcutils-4.0.2/src/shared_library.c:99, at /tmp/binarydeb/ros-galactic-rmw-implementation-2.4.1/src/functions.cpp:75, at /tmp/binarydeb/ros-galactic-rcl-3.1.2/src/rcl/init_options.c:75

And then the crash report pop-up occurs. Anyone has any ideas?


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-06-01 15:02:35 -0500

Gates gravatar image

I couldn't find out what the issue is but I found a way around. I removed the ROS2 apt in my source list. Uninstalled all ROS2 incidences and installed again following the Debian tutorial. Now, everything works fine.

I don't close the topic as solved because I still don't know what the issue was. If someone has any ideas, I would love to learn.

edit flag offensive delete link more


Apparently the ubuntu libfmt-dev package doesn't contain a loadable library, it installed static lib instead.

While the debian one does.

raymondtan85 gravatar image raymondtan85  ( 2021-08-01 08:14:20 -0500 )edit

How to solve this? I am having the same problem. How do I install the Debian libfmt package that does provide the .so file?

I am running Ubuntu 20.04 and installed ROS2 following the "Installing ROS 2 on Ubuntu Linux" at

Cannot run the example:

$ . ~/ros2_galactic/ros2-linux/setup.bash $ ros2 run demo_nodes_cpp talker /home/xxx/ros2_galactic/ros2-linux/lib/demo_nodes_cpp/talker: error while loading shared libraries: cannot open shared object file: No such file or directory


high12noon gravatar image high12noon  ( 2021-08-06 13:24:50 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2021-06-01 14:24:54 -0500

Seen: 1,139 times

Last updated: Jun 01 '21