haskellleksah

Haskell GUI application runs from Leksah, but crashes when .exe invoked from command line


When I Run the minimalistic program (listed below) from the Leksah IDE (version 0.16.2.2, on Win 7 64-bit system) the window opens correctly. But when the exe-file generated by Leksah is launched from the command line, some other window opens instead with the following message:

Entry Point Not Found
The procedure entry point pthread_cond_timedwait_relative_np could not be located in the dynamic link library libwinpthread-1.dll.

import Graphics.UI.Gtk

main = do
   initGUI
   window <- windowNew
   widgetShowAll window
   mainGUI

(To build this code in Leksah, the package-related cabal file has to also contain gtk3 -any in the build-depends section.)


Solution

  • I got this answer from Hamishmack here: https://github.com/leksah/leksah/issues/442 :

    Add leksah's bin directory to your PATH before launching the .exe. Something like:

    set PATH=%PATH%;C:\Leksah\bin
    

    Alternatively copy the missing DLL files from the C:\Leksah\bin directory into the same directory as your .exe file.