webui-dev / nim-webui

Use any web browser as GUI, with Nim in the backend and HTML5 in the frontend.
https://webui.me
MIT License
130 stars 9 forks source link

hello_world.exe crashes no matter what pwd is used #5

Closed retsyo closed 1 year ago

retsyo commented 1 year ago

I am using latesed cloned webui4nim and webui. I have copied webui\include\*.h to this webui4nim So I can generated hello_world.exe in MSYS2+Mingw64 on my windows 10 64bits with just nim c -r hello_world.nim

hello_world.exe can be lauched. However, no matter what password is used, when I click "check password", it crashed. But as we know, some message should be printed in MSYS2 console

AlbertShown commented 1 year ago

Thank you for your report. I'm testing it right now using MSYS2 MINGW64.

Install needed packages

pacman -Syuu
pacman -S mingw-w64-x86_64-gcc
pacman -S git
pacman -S mingw-w64-x86_64-nim
pacman -S mingw-w64-x86_64-nimble

Clone

git clone --recursive https://github.com/neroist/webui.git
cd webui/examples

Build

$ nim c -r hello_world.nim
C:\msys64\home\xxxx\webui\examples\nim.cfg(2, 3) Error: invalid command line option: '--mm'

$ nim c -d:useWebviewStaticLib hello_world.nim
C:\msys64\home\xxxx\webui\examples\nim.cfg(2, 3) Error: invalid command line option: '--mm'

@neroist any suggestion?

AlbertShown commented 1 year ago

I re-test it outside of MSYS2 and it's working fine.

Windows Terminal

cd C:\msys64\home\xxxx\webui\examples
nimble install webui
nim c -d:useWebviewStaticLib hello_world.nim

image

retsyo commented 1 year ago

well it turns out the bug lives in latest nim. If I switch to nim 1.6.10, everything is ok.

AlbertShown commented 1 year ago

I test it using Nim v1.6.12. And it's working fine. Are you using static or dynamic builds?

sandytypical commented 1 year ago

It is related to threads. Using tlsemulation:off or threads:off works with the devel compiler.

neroist commented 1 year ago

@retsyo did using tlsemulation:off or threads:off solve the issue for you?

retsyo commented 1 year ago

yes, threads:off solves the issue