#11748: GHC runtime linker: fatal error: I found a duplicate definition for symbol -------------------------------------+------------------------------------- Reporter: jeiea | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 (Linking) | Resolution: duplicate | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: #11223 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Phyx-): * status: new => closed * resolution: => duplicate * related: => #11223 Comment: Right, looking at it more closely, I think I understand the problem. The `Win32` package already provides a function named `rgb`. Due to the call `C.include "<Windows.h>"` in `Lib.hs`. The TH seems to be producing another function called `rgb` and hence the duplicate symbols error. GHC 7.x uses the old runtime linker which greedily loads symbols. So even though you don't use any symbols from the `Win32` package. Because you're linking against it an error is given. The second issue is that it's linking against the full `Win32.o` object file that cabal produces instead of the `Win32.a` file. In any case, you can't solve this in 7.10.3, you need the fix of #11223. So this is a combination of things, but I'll mark it as a duplicate since for it to work you'll need GHC 8.0. Feel free to re-open it if that doesn't solve it. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11748#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler