How can I compile the GUI executable with ghc?

I ported a small Haskell program that I wrote from a Mac to Windows. This is a GUI application (wxHaskell compiled with ghc 6.12.1), so it does not need to open a command prompt window. One way or another, therefore my question is: what should I do so that the program starts without opening the help window? Is there any ghc switch for this?

+4
source share
2 answers

When using wxWidgets with cygwin, you can avoid the appearance of the console window passing the -mwindows flag to the linker . You can tell GHC to pass flags to the linker using the -optl prefix so you can try creating -optl-mwindows and see if this works

I did this before when I created the Haskell SDL application for Windows, and it worked for me. I think the -mwindows flag -mwindows specific to cygwin, but I'm not sure if your GHC installation can be used as a linker.

+6
source

I donโ€™t have access to the GHC on Windows, but it looks like you need to tell the linker to use the windows subsystem. ghc -optl-mwindows ... might work.

+4
source

Source: https://habr.com/ru/post/1312574/


All Articles