<div dir="ltr"><div class="" itemprop="text">

<p>I am checking out the computing music development library Euterpea, and I am trying to compile the following basic program:</p>

<pre style class=""><code><span class="">import</span><span class=""> Euterpea

    t251 </span><span class="">::</span><span class=""> Music Pitch
    t251 </span><span class="">=</span><span class=""> </span><span class="">let</span><span class=""> dMinor </span><span class="">=</span><span class=""> d </span><span class="">4</span><span class=""> wn </span><span class="">:=:</span><span class=""> f </span><span class="">4</span><span class=""> wn </span><span class="">:=:</span><span class=""> a </span><span class="">4</span><span class=""> wn
               gMajor </span><span class="">=</span><span class=""> g </span><span class="">4</span><span class=""> wn </span><span class="">:=:</span><span class=""> b </span><span class="">4</span><span class=""> wn </span><span class="">:=:</span><span class=""> d </span><span class="">5</span><span class=""> wn
               cMajor </span><span class="">=</span><span class=""> c </span><span class="">4</span><span class=""> bn </span><span class="">:=:</span><span class=""> e </span><span class="">4</span><span class=""> bn </span><span class="">:=:</span><span class=""> g </span><span class="">4</span><span class=""> bn
           </span><span class="">in</span><span class=""> dMinor </span><span class="">:+:</span><span class=""> gMajor </span><span class="">:+:</span><span class=""> cMajor

    main </span><span class="">=</span><span class=""> play t251</span></code></pre>

<p>the program works fine inside ghci, but when I try to compile it using <code>ghc test.hs</code> I get the following error message:</p>

<p>Linking test ... /usr/bin/ld: 
/home/fayong/.cabal/lib/PortMidi-0.1.3/ghc-7.6.3/libHSPortMidi-0.1.3.a(ptlinux.o):
 undefined reference to symbol 'pthread_create@@GLIBC_2.2.5' 
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO 
missing from command line collect2: error: ld returned 1 exit status</p>

<p>It seems to be a linking error but I don't know how to fix it. (I tried to pass -lpthread as an option but it didn't work)</p>

<p>I installed Euterpea via cabal, on linux mint 17</p>
    </div></div>