-
Notifications
You must be signed in to change notification settings - Fork 16
Windows System Error can't find libwinpthread-1.dll #66
Comments
Hi, I think you can take a look at Troubleshooting section of readme https://github.com/greenfork/nimraylib_now#windows-error-the-application-was-unable-to-start-correctly-0x00000007b |
I'm having this problem too. Even after adding C:\Program Files\nim-1.6.2\dist\mingw64\bin to path, I still get "Windows error: The application was unable to start correctly (0x00000007b)" on other windows machines, although it ran on the one with mingw installed. I tried installing and setting path for mingw installed via msys with the same result. I'm on Windows 11. |
Why does raylib need pthreads? |
So I tried with |
I tried compiling on a Windows 10 machine where I installed using choosenim. I think on the 11 I installed the binary on the nim website (it's installed in Program Files). Now it runs when I have libwinpthread-1.dll in the same directory on another Windows 10 computer and also the Windows 11 computer after removing libwinpthread-1.dll from the mingw\bin directory so it can't use that one. Also, adding mingw\bin to the system path, rebooting, recompiling with --passC:"-static" --passL:"-lpthread", and running again on a different Windows 10 machine did not allow me to run without the libwinpthread-1.dll in the directory. |
This is still connected to the wrong paths since the problem is not with the library but with Windows being unable to properly locate it. It is a hard sign that something is wrong with the paths.
This successfully resolved the problem for this issue #2. I'm not sure what's wrong in your case.
Raylib requires pthreads for some functionality. So linking is enabled by default for NimraylibNow. Disabling it by default won't solve the problem because once you need it, you will be in the same situation. Overall, if you can find a recipe of what we need to change to make it work out of the box, we can add it to the library. But that being said, my understanding is that a lot of people use this library on Windows and they don't have these problems or they successfully solve them. I will leave this issue open for some time so people can help. I think that we need to add some instruction on how to properly add the PATH to Windows to make it work. Or just to plainly copy the .dll since you will still have to distribute this game. Or maybe we can add some link step which will correctly detect the location of this .dll and link it on any Windows machine. |
I think it might be specific to compiling on Windows 11, since it worked when I compiled on Windows 10 (albeit only with the .dll in the directory) |
My issues were with Windows 11 as well |
So far this is the best option: bundle
|
It would be interesting to know where the library is searched. Can you check with strace? (In the git for windows installation or some tool mentioned here: https://stackoverflow.com/questions/3847745/systrace-for-windows ) then it would be much easier to track down the issue. |
@creikey @milanbt there's a possible solution in the PR, do you have time to check if that works for you? |
After following the readme and doing
Then trying to run a nim file with just
import nimraylib_now
in it
With
I get this error:
The text was updated successfully, but these errors were encountered: