0
$\begingroup$

Rosanswers logo

Hi all,

After I run my node with ros2 run .. I always got a popup saying this:

The code execution cannot proceed because libpthread.dll was not found. Reinstalling the program may fix the problem.

In my code I'm including pthread.h, and since I'm on Windows I downloaded the sources from here. Then I retargeted the project and built it as Release x64. So in the end I have libpthread.lib and libpthread.dll in the same folder. Now, in my CMakeLists I have:

include_directories("C:/path_to_pthread.h")
link_directories("C:/path_to_libpthread.lib")
target_link_libraries(name libpthread)

I can build my code correctly, but when I run it I got that windows popup. I've also tried to rebuild pthread many times, but it doesn't change anything.

I can't understand why it doesn't find the .dll when it is in the exact same folder of the .lib, that seems to be found.

What am I doing wrong? Can someone help me?


Originally posted by alberto on ROS Answers with karma: 100 on 2022-03-21

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Did you try to put your DLL in the system folder and register it? Like in this FAQ.


Originally posted by ljaniec with karma: 3064 on 2022-03-21

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by alberto on 2022-03-21:
That's what I was missing! thank you!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.