I was trying to write a binding to a foreign library (of which the dev version is installed by
apt in my system, liberfa ).
stack build errors out on cabal:
Cabal-simple_mPHDZzAJ_220.127.116.11_ghc-8.6.5: Missing dependencies on foreign libraries: * Missing (or bad) C libraries: liberfa, liberfa [ ... and then a block of text about either using -L or installing it globally with the system package manager ...]
It is installed but even if I pass the location with
-L explicitly I still get the same error:
scasc-@local:~/dev/test-binding$ find /usr -name 'liberfa*' /usr/lib/x86_64-linux-gnu/liberfa.a /usr/lib/x86_64-linux-gnu/liberfa.so /usr/share/doc/liberfa-dev scasc-@local:~/dev/test-binding$ stack build --ghc-options -L/usr/lib/x86_64-linux-gnu Building all executables for `haskell-bench' once. After a successful build of all of them, only specified executables will be rebuilt. configure (lib + exe) Configuring haskell-bench-0.1.0.0... Cabal-simple_mPHDZzAJ_18.104.22.168_ghc-8.6.5: Missing dependencies on foreign libraries: * Missing (or bad) C libraries: liberfa, liberfa
I even tried copying the
.so files into the development libraries and adding the location to
extra-lib-dirs . Any ideas how I could proceed?