
Hi all, I'm a newbie to nhc and I'm trying to compile a simple "hello world" program: module Main where main = putStr "hello world" with nhc98 hello.hs or nhc98 hello.hs -o hello.exe but the following messages appera: C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/main.o(.text+0xa2):main.c: unde fined reference to `setjmp' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/main.o(.text+0xdd):main.c: unde fined reference to `_impure_ptr' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/main.o(.text+0x12a):main.c: und efined reference to `_impure_ptr' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/mutator.o(.text+0x2d2):mutator. c: undefined reference to `_impure_ptr' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/mutator.o(.text+0x425):mutator. c: undefined reference to `_impure_ptr' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/mutator.o(.text+0x44d):mutator. c: undefined reference to `_impure_ptr' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/mutator.o(.text+0x2ac9):mutator .c: more undefined references to `_impure_ptr' follow C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(haskellInit.o)(.text+ 0x94):haskellInit.c: undefined reference to `_imp___ctype_' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(haskellInit.o)(.text+ 0x180):haskellInit.c: undefined reference to `_impure_ptr' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(haskellInit.o)(.text+ 0x504):haskellInit.c: undefined reference to `_impure_ptr' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(haskellInit.o)(.text+ 0x757):haskellInit.c: undefined reference to `_impure_ptr' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(haskellInit.o)(.text+ 0x771):haskellInit.c: undefined reference to `_impure_ptr' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(haskellInit.o)(.text+ 0x7ca):haskellInit.c: undefined reference to `_impure_ptr' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(haskellInit.o)(.text+ 0x93f):haskellInit.c: more undefined references to `_impure_ptr' follow C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(cIOExtras.o)(.text+0x d7):cIOExtras.c: undefined reference to `__errno' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(mark.o)(.text+0x498): mark.c: undefined reference to `_impure_ptr' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(mark.o)(.text+0x568): mark.c: undefined reference to `_impure_ptr' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(mark.o)(.text+0x6f8): mark.c: undefined reference to `_impure_ptr' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(mark.o)(.text+0x90a): mark.c: undefined reference to `_impure_ptr' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(timeUnix.o)(.text+0x4 3):timeUnix.c: undefined reference to `times' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(timeUnix.o)(.text+0x6 5):timeUnix.c: undefined reference to `_impure_ptr' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(timeUnix.o)(.text+0xb 3):timeUnix.c: undefined reference to `times' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(timeUnix.o)(.text+0xd 2):timeUnix.c: undefined reference to `_impure_ptr' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(timeUnix.o)(.text+0x1 13):timeUnix.c: undefined reference to `times' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(timeUnix.o)(.text+0x1 32):timeUnix.c: undefined reference to `_impure_ptr' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(stableptr.o)(.text+0x 199):stableptr.c: undefined reference to `_impure_ptr' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(stableptr.o)(.text+0x 33a):stableptr.c: undefined reference to `_impure_ptr' I'm running version 1.16 at Windows XP with Cygwin. Does anyone have any idea about what is happening? Thanks in advance, Monique

Monique Louise
C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/main.o(.text+0xa2):main.c: undefined reference to `setjmp' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/main.o(.text+0xdd):main.c: undefined reference to `_impure_ptr' C:/cygwin/usr/local/lib/nhc98/ix86-CYGWIN_NT-5.1/Runtime.a(haskellInit.o) haskellInit.c: undefined reference to `_imp___ctype_' ...
I'm running version 1.16 at Windows XP with Cygwin. Does anyone have any idea about what is happening?
It looks like there is a mismatch between the standard C library that nhc98 was compiled against, and the C library that is available on your machine. I guess you downloaded the binary distribution of nhc98 for Cygwin? Maybe you could try building nhc98 directly on your machine from sources. Regards, Malcolm
participants (2)
-
Malcolm Wallace
-
Monique Louise