In my project I'm using a library that depends on two C packages: sqlite3
and libsqlite3-dev
. I installed them using apt-get install
and then build the project with stack build
and everything works fine.
However, the stack build
fails when used with nix with error message "* Missing C library: sqlite3". I understand that the nix enviroment is isolated and that I have to install it there. I tried installing it using nix-env -i sqlite3
but it returns error: selector ‘sqlite3’ matches no derivations
. It looks it is missing in the channel (using nixpkgs-unstable).
Is there any way how use to use C libraries with stack and nix that are missing in the channel?
I am using nix because of a bug in IHaskell, otherwise I would be fine with just stack.
Copyright Notice:Content Author:「Erik Cupal」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/47823825/missing-c-library-error-during-stack-build-with-nix