title: Haskell Coverage - HPC can not find Main
body: <p>I have a program that is built up of many C++ and Haskell files.
  I compile all of the Haskell with <code>-fhpc</code> flag so that I may run coverage tests on it.</p>
  
  <p>After compiling is finished,  I run the program and several <code>.tix</code> files are generated.  </p>
  
  <p>The problem: I attempt to run <code>hpc markup build/Server --srcdir=.</code> for instance.
  It will then generate some files, but fail prematurely:  </p>
  
  <pre><code>Writing: file1.hs.html
  Writing: file2.hs.html
  Writing: file3.hs.html
  hpc: can not find Main in ["./.hpc"]
  </code></pre>
  
  <p>The directory <code>.hpc</code> exists, and it does contain a file called <code>Main.mix</code> alongside other <code>.mix</code> files.</p>
  
  <p>I've noticed some people reporting the same issues on IRC chat logs, but nowhere have I found a solution for this.
  Does anyone have this experience with hpc?</p>
  
  <p>Edit: How I compile
  I have a fairly complicated compiling scheme.
  I actually just <a href="https://stackoverflow.com/questions/25424615/how-to-link-custom-object-file-with-haskell-library/25660388#25660388">wrote it down in another question</a>.</p>
  
  <p>I use a very specific package library which I specify explicitly by using <code>--no-user-package-db</code> and <code>--package-db=/usr/local/ghc-7.6.3-200814</code>.
  That <a href="http://pastebin.com/uWuwqgAA" rel="nofollow noreferrer">directory's listings is available here</a></p>