Strange error during compilation/linking

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Strange error during compilation/linking

Erik Quaeghebeur-2
Hi,


I get the following error while compiling (I guess it's actually the
linking step):

$ghc -o cmimc cmimc.hs
cmimc.o: In function `rP1_info':
(.text+0x32a): undefined reference to
`containerszm0zi2zi0zi1_DataziMap_zdf2_closure'
cmimc.o: In function `rP3_info':
(.text+0x396): undefined reference to
`containerszm0zi2zi0zi1_DataziMap_zdf2_closure'
cmimc.o: In function `rPh_info':
(.text+0x666): undefined reference to
`containerszm0zi2zi0zi1_DataziMap_fromList_closure'
cmimc.o: In function `rPj_info':
(.text+0x6ca): undefined reference to
`containerszm0zi2zi0zi1_DataziMap_fromList_closure'
cmimc.o: In function `sR5_info':
(.text+0x1225): undefined reference to
`__stginit_containerszm0zi2zi0zi1_DataziMap_'
cmimc.o: In function `rP1_srt':
(.data+0x90): undefined reference to
`containerszm0zi2zi0zi1_DataziMap_zdf2_closure'
cmimc.o: In function `rP3_srt':
(.data+0xac): undefined reference to
`containerszm0zi2zi0zi1_DataziMap_zdf2_closure'
cmimc.o: In function `rPh_srt':
(.data+0x15c): undefined reference to
`containerszm0zi2zi0zi1_DataziMap_fromList_closure'
cmimc.o: In function `rPj_srt':
(.data+0x174): undefined reference to
`containerszm0zi2zi0zi1_DataziMap_fromList_closure'
collect2: ld returned 1 exit status

However, running the program with ghci:
$ghci cmimc.hs
Prelude Main> :set args "testinput.txt"
Prelude Main> :trace main

gives the correct output...

Where might there be a problem? In my installation (Kubuntu i386,
ghc6.10.4-1ubunbtu2) perhaps?

Please tell me if/which additional info I need to provide.


TIA,

Erik

Reply | Threaded
Open this post in threaded view
|

Re: Strange error during compilation/linking

Maciej Piechotka
On Wed, 2010-03-17 at 20:27 -0400, Erik Quaeghebeur wrote:
> Hi,
>
>
> I get the following error while compiling (I guess it's actually the
> linking step):
>
> $ghc -o cmimc cmimc.hs

ghc -o cmimc cmime.hs --make

or

ghc -o cmimc cmime.hs --package package-you-use

> cmimc.o: In function `rP1_info':
> (.text+0x32a): undefined reference to
> `containerszm0zi2zi0zi1_DataziMap_zdf2_closure'
> cmimc.o: In function `rP3_info':
> (.text+0x396): undefined reference to
> `containerszm0zi2zi0zi1_DataziMap_zdf2_closure'
> cmimc.o: In function `rPh_info':
> (.text+0x666): undefined reference to
> `containerszm0zi2zi0zi1_DataziMap_fromList_closure'
> cmimc.o: In function `rPj_info':
> (.text+0x6ca): undefined reference to
> `containerszm0zi2zi0zi1_DataziMap_fromList_closure'
> cmimc.o: In function `sR5_info':
> (.text+0x1225): undefined reference to
> `__stginit_containerszm0zi2zi0zi1_DataziMap_'
> cmimc.o: In function `rP1_srt':
> (.data+0x90): undefined reference to
> `containerszm0zi2zi0zi1_DataziMap_zdf2_closure'
> cmimc.o: In function `rP3_srt':
> (.data+0xac): undefined reference to
> `containerszm0zi2zi0zi1_DataziMap_zdf2_closure'
> cmimc.o: In function `rPh_srt':
> (.data+0x15c): undefined reference to
> `containerszm0zi2zi0zi1_DataziMap_fromList_closure'
> cmimc.o: In function `rPj_srt':
> (.data+0x174): undefined reference to
> `containerszm0zi2zi0zi1_DataziMap_fromList_closure'
> collect2: ld returned 1 exit status
>
> However, running the program with ghci:
> $ghci cmimc.hs
> Prelude Main> :set args "testinput.txt"
> Prelude Main> :trace main
>
> gives the correct output...
>
> Where might there be a problem? In my installation (Kubuntu i386,
> ghc6.10.4-1ubunbtu2) perhaps?
>

No. ghci/runhaskell automatically loades additional libraries. ghc do
not.

> Please tell me if/which additional info I need to provide.
>
>
> TIA,
>
> Erik
>

Regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/beginners/attachments/20100317/03cafbbc/attachment.bin