Search code examples
haskellgcclinkerldwxhaskell

Linker error while building statically-linked wxHaskell application


I am trying to statically link a wxHaskell Windows application using this ghc -static -optl-static flag. But ld.exe returns a linker error

c:/program files/haskell platform/2014.2.0.0/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxc collect2: ld returned 1 exit status

I seemingly can't find lwxc in my system anywhere. Is there anything that I can do?

Edit: I have libwxc.a in

E:\wxhaskell\wxc\libwxc.a


Solution

  • What the linker is telling you is that it can't find the library because it is not in the standard location that it knows... Add it to GHC's library search path by adding the -L flag to the command:

    ghc -static .... -LE:/wxhaskell/wxc ....