Hi Justin,

I've compiled programs on windows 7 and the console won't appear. Can you give us a little more info? Is the code available on github? Can you send us the console session that you execute and/or your cabal file?

I don't think any of the -static, -optl-static,... options will ever spare you from having to take GTK's dlls with you. I think these options are only designed to include the haskell libraries (i.e. gtk2hs) in the final executable. In the past I have used tools to *bundle* the dlls and the exe together. These tools extract the dlls in runtime. There are also tools that turn dlls into libraries that you can link with your exe. I don't use this anymore, I just redistribute a setup.exe that installs everything the first time. If you google "bundle dlls with exe", you'll sure find many tools that you can use.

If you are worried about the number of dlls, size, etc., you might want to consider using wx. Not that this is the place to advertise it, but for very simple programs, the fingerprint is smaller and the results are also good.


On 3 November 2012 14:31, Justin Greene <justin.j.greene@gmail.com> wrote:

I have been attempting to get my first gtk2hs application building the way I like it and need some assistance at this point.

My first and probably most important issue is that I can't get -optl-mwindows to work (e.g. it doesn't hide the console window on windows 7 or 8). I put this in the ghc-options like this post: http://projects.haskell.org/gtk2hs/archives/2005/06/23/hiding-the-console-on-windows/ says to, but it doesn't seem to do anything.

Second I've been unable to get my project to build as a single standalone executable, no matter what options I specify it always builds with dependencies on the gtk .dlls. I have so far tried ghc-options: -static -optl-static, cabal-dev install -fstatic -optl-static, ld-options: -static etc. Nothing works. I have ensured that the build can only see the gtk/include and gtk/lib directory but I still end up with a small executable and dependencies upon the gtk .dlls.

Any help would be appreciated.

LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
Gtk2hs-users mailing list