Skip to content

Linking standard library fails

This simple program fails to link:

import System

main = putStrLn "Hallo, Welt"

This is the compiler output:

$ ghc -c test.hs

$ ghc -o test test.o

test.o: In function sds_info': (.text+0x1e7): undefined reference to __stginit_haskell98zm1zi1zi0zi1_System_'

collect2: ld returned 1 exit status

When you compile test.hs directly to test (without the step test.o), then it works:

$ ghc -o test test.hs

Linking test ...

Trac metadata
Trac field Value
Version 7.0.4
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information