Casey Hawthorne | 12 Nov 21:12

Why can I run (runghc) some Haskell scripts but I cannot seem to compile them?

Why can I run (runghc) some Haskell scripts but I cannot seem to
compile them?

e.g. http://www.haskell.org/all_about_monads/examples/example25.hs

I've changed the import listing to the following:

import IO
import System
import Monad
import Data.Maybe
import Data.List
import Data.Char (toLower)
import Control.Monad.State
import Control.Monad.Writer

The compiler errors are like the following:
N-Queens.o:fake:(.text+0x2fe): undefined reference to
`mtlzm1zi1zi0zi2_Controlzi
MonadziStateziLazzy_zdf9_closure'
N-Queens.o:fake:(.text+0x422): undefined reference to
`mtlzm1zi1zi0zi2_Controlzi
MonadziStateziLazzy_zdf7_closure'
N-Queens.o:fake:(.text+0x66f6): undefined reference to
`mtlzm1zi1zi0zi2_Controlz
iMonadziWriterziLazzy_zdf1_closure'

--
Regards,
Casey
Daniel Peebles | 12 Nov 21:13
Picon
Gravatar

Re: Why can I run (runghc) some Haskell scripts but I cannot seem to compile them?

Did you try ghc --make?

On Thu, Nov 12, 2009 at 3:12 PM, Casey Hawthorne <caseyh <at> istar.ca> wrote:

> Why can I run (runghc) some Haskell scripts but I cannot seem to > compile them? > > e.g. http://www.haskell.org/all_about_monads/examples/example25.hs > > I've changed the import listing to the following: > > import IO > import System > import Monad > import Data.Maybe > import Data.List > import Data.Char (toLower) > import Control.Monad.State > import Control.Monad.Writer > > The compiler errors are like the following: > N-Queens.o:fake:(.text+0x2fe): undefined reference to > `mtlzm1zi1zi0zi2_Controlzi > MonadziStateziLazzy_zdf9_closure' > N-Queens.o:fake:(.text+0x422): undefined reference to > `mtlzm1zi1zi0zi2_Controlzi > MonadziStateziLazzy_zdf7_closure' > N-Queens.o:fake:(.text+0x66f6): undefined reference to > `mtlzm1zi1zi0zi2_Controlz > iMonadziWriterziLazzy_zdf1_closure' > > -- > Regards, > Casey > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe <at> haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe >
Casey Hawthorne | 12 Nov 21:40
Picon

Re: Why can I run (runghc) some Haskell scripts but I cannot seem to compile them?

Shazam!

Thank you!

On Thu, 12 Nov 2009 15:13:47 -0500, you wrote:


>Did you try ghc --make? > >On Thu, Nov 12, 2009 at 3:12 PM, Casey Hawthorne <caseyh <at> istar.ca> wrote: >> Why can I run (runghc) some Haskell scripts but I cannot seem to >> compile them? >> >> e.g. http://www.haskell.org/all_about_monads/examples/example25.hs >> >> I've changed the import listing to the following: >> >> import IO >> import System >> import Monad >> import Data.Maybe >> import Data.List >> import Data.Char (toLower) >> import Control.Monad.State >> import Control.Monad.Writer >> >> The compiler errors are like the following: >> N-Queens.o:fake:(.text+0x2fe): undefined reference to >> `mtlzm1zi1zi0zi2_Controlzi >> MonadziStateziLazzy_zdf9_closure' >> N-Queens.o:fake:(.text+0x422): undefined reference to >> `mtlzm1zi1zi0zi2_Controlzi >> MonadziStateziLazzy_zdf7_closure' >> N-Queens.o:fake:(.text+0x66f6): undefined reference to >> `mtlzm1zi1zi0zi2_Controlz >> iMonadziWriterziLazzy_zdf1_closure' >> >> -- >> Regards, >> Casey >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe <at> haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >>
-- Regards, Casey

Gmane