Alex Rivera | Logout

Haskell - Issue Compiling in GHC

Asked 2012-02-16T22:32:11.973
14

I'm very new to Haskell, and I've recently installed the platform with GHC. I decided to test it out by compiling a simple Hello world program: main = putStrLn "Hello, world"

Now, when I go into the command line (Windows 7), find the proper directory, and type in ghc hello.hs, it comes back with the following message: "[1 of 1] Compiling Main ( hello.hs, hello.o )". I understand that once it's done compiling, it should follow with "Linking hello.exe ...", but that never comes, and no .exe is produced.

Basically, is there any discernible reason why this would be happening? Is there a problem with the code, is there something I don't know about, or should I just try re-installing the Haskell Platform?

Thank you.

Edit
Report

1 Answer

1

I would use the --make option, as in ghc --make hello.hs. (You can actually leave out the file extension if you like.) This will automatically figure out what needs to be done, which packages if any need to be linked in, and generally do everything you'd expect.

answered 2012-02-17T10:30:27.880

Your Answer