fpco / inline-c

284 stars 49 forks source link

When using Cabal, C functions are not linked when hs-source-dirs is '.' #45

Closed jyp closed 8 years ago

jyp commented 8 years ago

When hs-source-dirs is ., then the generated source file has the same location as the Haskell file, except for the extension:

Example.hs
Example.c

This means that the .o file generated by GHC overwrite the .o file generated by the C compiler. At link time it is then lost.

bitonic commented 8 years ago

Yes, this is a known issue (see #21 ). I haven't found a great way to avoid this automatically. We should probably at least warn people to not use . for hs-source-dir.