【发布时间】:2015-07-11 19:34:39
【问题描述】:
我正在查看计算音乐开发库 Euterpea,我正在尝试编译以下基本程序:
import Euterpea
t251 :: Music Pitch
t251 = let dMinor = d 4 wn :=: f 4 wn :=: a 4 wn
gMajor = g 4 wn :=: b 4 wn :=: d 5 wn
cMajor = c 4 bn :=: e 4 bn :=: g 4 bn
in dMinor :+: gMajor :+: cMajor
main = play t251
该程序在 ghci 中运行良好,但是当我尝试使用 ghc test.hs 编译它时,我收到以下错误消息:
链接测试 ... /usr/bin/ld: /home/fayong/.cabal/lib/PortMidi-0.1.3/ghc-7.6.3/libHSPortMidi-0.1.3.a(ptlinux.o): 对符号“pthread_create@@GLIBC_2.2.5”的未定义引用 //lib/x86_64-linux-gnu/libpthread.so.0:添加符号时出错:DSO 命令行 collect2 中缺失:错误:ld 返回 1 个退出状态
这似乎是一个链接错误,但我不知道如何解决它。我尝试将-lpthread 作为选项传递,但它也不起作用。
我通过 cabal 在 linux mint 17
上安装了 Euterpea【问题讨论】:
-
我遇到了同样的问题,在 Manjaro 3.17.8-1 上使用来自 cabal 的 Euterpea-1.0.0。我可以在 ghci 中“玩”,但不能通过 ghc。
标签: haskell linker cabal linux-mint euterpea