Error: ld: duplicate symbol in Haskell

I was trying to compile a Haskell code using ghc (v7.0.3).

I had compiled a library code:

> ghc -c MyLib.hs

And then tried to link with my application:

> ghc Main.hs MyLib.o

It seems that ghc already includes the object files for dependencies, so this would explain the duplicate. Thus, it suffices to compile it using:

> ghc Main.hs

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s