Ask Your Question
0

dll not found error when running ROS2 examples, any node, publish from command line on Windows 10

asked 2018-08-31 07:46:30 -0500

Marcel Usai gravatar image

updated 2018-09-04 09:38:02 -0500

Hi, I am setting up ROS2 Bouncy on Windows10 and already encountered the following problem while compiling from source: ROS2 fails to build many packages on Windows 10, which I solved.


EDIT: I found this question to be the same issue.


Now, my code compiles and I want to test the examples. But when I run the talker example node, it gives me this output:

cd \dev\ros2
call install\local_setup.bat
ros2 run demo_nodes_py talker
>>> [rcutils|error_handling.c:155] rcutils_set_error_state()
This error state is being overwritten:

  'failed to load shared library of rmw implementation. Exception: Cannot load library: C:\dev\ros2\install\bin/rmw_fastrtps_cpp.dll, at c:\dev\ros2\src\ros2\rmw_implementation\rmw_implementation\src\functions.cpp:135'

with this new error message:

  'failed to load shared library of rmw implementation. Exception: Cannot load library: C:\dev\ros2\install\bin/rmw_fastrtps_cpp.dll, at c:\dev\ros2\src\ros2\rmw_implementation\rmw_implementation\src\functions.cpp:135'

rcutils_reset_error() should be called after error handling to avoid this.
<<<

With the error message above repeating many times...

>>> [rcutils|error_handling.c:155] rcutils_set_error_state()
This error state is being overwritten:

  'failed to load shared library of rmw implementation. Exception: Cannot load library: C:\dev\ros2\install\bin/rmw_fastrtps_cpp.dll, at c:\dev\ros2\src\ros2\rmw_implementation\rmw_implementation\src\functions.cpp:135'

with this new error message:

  'failed to load shared library of rmw implementation. Exception: Cannot load library: C:\dev\ros2\install\bin/rmw_fastrtps_cpp.dll, at c:\dev\ros2\src\ros2\rmw_implementation\rmw_implementation\src\functions.cpp:135'

rcutils_reset_error() should be called after error handling to avoid this.
<<<
Traceback (most recent call last):
  File "C:\dev\ros2\install\lib\demo_nodes_py\talker-script.py", line 11, in <module>
    load_entry_point('demo-nodes-py==0.5.1', 'console_scripts', 'talker')()
  File "C:\dev\ros2\install\Lib\site-packages\demo_nodes_py\topics\talker.py", line 39, in main
    rclpy.init(args=args)
  File "C:\dev\ros2\install\Lib\site-packages\rclpy\__init__.py", line 27, in init
    args if args is not None else sys.argv)
RuntimeError: Failed to init: failed to load shared library of rmw implementation. Exception: Cannot load library: C:\dev\ros2\install\bin/rmw_fastrtps_cpp.dll, at c:\dev\ros2\src\ros2\rmw_implementation\rmw_implementation\src\functions.cpp:135, at c:\dev\ros2\src\ros2\rcl\rcl\src\rcl\rcl.c:92

EDIT: The exact same output is generated when I use demo_nodes_cpp. Also, when writing my own simple publisher in python, I get this error as well.

My rmw_implementation as well as all other packages (except for connext-related ones) compiled without error. Also, I find the rmw_fastrtps_cpp.dll in the given path (C:\dev\ros2\install\bin/rmw_fastrtps_cpp.dll). (It bugs me, that the path has mixed forward and backslashes.)

Maybe, I missed something in my setup? EDIT: Does this have to do with environment variables? If so, is there a list of variables which should be set?


EDIT: I managed to isolate the error to the ros init call:

def main(args=None):
    rclpy.init(args=args) # error produced by this line of code
    ...

So ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-09-10 09:19:04 -0500

Marcel Usai gravatar image

I got rid of this issue by:

  1. First setting my locale from German to English, then rebuilding from source and ignoring opensplice (as I actually do not need it). I do not know, if this step was really necessary.
  2. Reinstalling tinyxml2 as the respecting dll was not missing but unloadable. Actually, I followed these hints and reinstalled the dependencies asio, eigen, tinyxml-usestl and tinyxml2.

See also this issue as info: FastRTPS fails to find asio and tinyxml2 on Windows; and this info when you encounter problems uninstalling dependencies. I had issues reinstalling tinyxml2, so I had to remove the respecting registry entry manually because chocolatey would not install it otherwise.

Following these steps, the talker and listener nodes run as expected.

edit flag offensive delete link more

Comments

Glad you got it working! If you get a chance, could you try building a workspace from scratch using the german locale ? It would be valuable to know if there are issues with UTF-8 locales other than english.

marguedas gravatar imagemarguedas ( 2018-09-10 18:14:15 -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

2 followers

Stats

Asked: 2018-08-31 07:46:30 -0500

Seen: 728 times

Last updated: Sep 10 '18