
Hi, I'm interested in writing accessing some Win32 functions not available from GHC. I wrote this short little file and tried to compile: mywin32.hsc
module MyWin32 where
#include
Then tried to compile it like this: # hsc2hs mywin32.hsc # ghc -fffi mywin32.hs C:/system/ghc/ghc-6.6/libHSrts.a(Main.o):Main.c:(.text+0x1b): undefined reference to `__stginit_ZCMain' C:/system/ghc/ghc-6.6/libHSrts.a(Main.o):Main.c:(.text+0x3f): undefined reference to `ZCMain_main_closure' collect2: ld returned 1 exit status What am I missing? Thanks -John

On Sun, Feb 04, 2007 at 10:42:23PM +1100, John Ky wrote:
# hsc2hs mywin32.hsc # ghc -fffi mywin32.hs C:/system/ghc/ghc-6.6/libHSrts.a(Main.o):Main.c:(.text+0x1b): undefined reference to `__stginit_ZCMain' C:/system/ghc/ghc-6.6/libHSrts.a(Main.o):Main.c:(.text+0x3f): undefined reference to `ZCMain_main_closure' collect2: ld returned 1 exit status
What am I missing?
A function named main.

On 4 Feb 2007, at 17:59, Stefan O'Rear wrote:
On Sun, Feb 04, 2007 at 10:42:23PM +1100, John Ky wrote:
# hsc2hs mywin32.hsc # ghc -fffi mywin32.hs C:/system/ghc/ghc-6.6/libHSrts.a(Main.o):Main.c:(.text+0x1b): undefined reference to `__stginit_ZCMain' C:/system/ghc/ghc-6.6/libHSrts.a(Main.o):Main.c:(.text+0x3f): undefined reference to `ZCMain_main_closure' collect2: ld returned 1 exit status
What am I missing?
A function named main.
s/function/constant/ In a module called Main. Bob
participants (3)
-
John Ky
-
Stefan O'Rear
-
Thomas Davie