yglukhov / nimx

GUI library
MIT License
1.09k stars 75 forks source link

Problems regarding SDL2 #511

Closed tillfalko closed 1 year ago

tillfalko commented 1 year ago

(This is on a fresh nim install on Windows 11. This issue occurs whether the newest nim version is installed manually, or with choosenim. I tried both.)

Trying to run the README example script with nim c -r --threads:on main.nim results in

could not load: SDL2.dll
Error: execution of an external program failed: 'C:\Users\T\windev\n\main.exe '

nimble install sdl2 did not help. Eventually I was able to fix this by manually downloading the SDL2.dll file and putting it in the same directory as main.nim. I doubt that this is intended. Perhaps there is some obvious thing I am missing but as I am new to nim, this was very confusing.

I could also not get the nimx samples to work at all. No matter where I pasted SDL2.dll file, executing nake would always result in

c:/users/t/.choosenim/toolchains/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lSDL2
collect2.exe: error: ld returned 1 exit status
Error: execution of an external program failed: 'gcc.exe  @main_linkerArgs.txt'

At this point I have populated at least 10 folders relating to mingw, nim, choosenim, and nimx with the LSDL2.dll file but alas, nothing changes.

Tormund commented 1 year ago

This is looks similar to https://github.com/yglukhov/nimx/issues/504 did you seen this?

tillfalko commented 1 year ago

This is how I solved the issue. Is this expected, or did I mess up during the installation?

Tormund commented 1 year ago

Yes SDL is required and not shipped with nimx. https://github.com/yglukhov/nimx/blob/master/doc/hello-world-app.md