GHC链接问题 [英] GHC linking problem

查看:271
本文介绍了GHC链接问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编译以下代码。

I'm trying to compile the following code.

import Data.List
import Data.Ord
import qualified Data.MemoCombinators as Memo

collatzLength :: Int -> Int
collatzLength = Memo.arrayRange (1, 1000000) collatzLength'
  where
    collatzLength' 1 = 1
    collatzLength' n | odd n  = 1 + collatzLength (3 * n + 1)
                     | even n = 1 + collatzLength (n `quot` 2)

main = print $ maximumBy (comparing fst) $ [(collatzLength n, n) | n <- [1..1000000]]

Haskell编译器溢出:

The Haskell compiler spits out:

euler14.o: In function `s1pw_info':
(.text+0x8dd): undefined reference to `__stginit_datazmmemocombinatorszm0zi4zi1_DataziMemoCombinators_'
euler14.o: In function `rfX_info':
(.text+0x35d): undefined reference to `datazmmemocombinatorszm0zi4zi1_DataziMemoCombinators_arrayRange_info'
euler14.o: In function `rfX_srt':
(.data+0x4c): undefined reference to `datazmmemocombinatorszm0zi4zi1_DataziMemoCombinators_arrayRange_closure'
collect2: ld returned 1 exit status

尝试谷歌,但没有效果。有没有地方可以查找这些错误?

I tried googling, but to no avail. Is there anywhere these errors can be looked up? What do they mean?

推荐答案

您必须使用 - make 标记。

这篇关于GHC链接问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆