Missing C library error during stack build with nix
NickName:Erik Cupal Ask DateTime:2017-12-15T07:46:19

Missing C library error during stack build with nix

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

More about “Missing C library error during stack build with nix” related questions

Missing C library error during stack build with nix

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...

Show Detail

stack --nix build complains about ghc version mismatch

When building threepenny-gui on NixOS with stack --nix build, I got error saying I have the wrong version of ghc. Then I tried stack --nix setup, which doesn't run because bash is on an unexpected ...

Show Detail

Duplicate library linking with Stack and Nix

I'm using stack's support for nix to build a library that depends on gfortran. Everything builds normally, but when running I get the error: error while loading shared libraries: libgfortran.so.3:

Show Detail

Build simple haskell library using nix

I've been interested in Nix for a while, and I thought I would finally try to use it for starting a new haskell project. I began with the directory structure project.cabal src/Lib.hs Where the c...

Show Detail

How to use stack with nix to build wxHaskell project?

I'm trying to set up a build environment for wxHaskell using Nix and Stack. I've installed wxWidgets-3.0.2 through nix. This is the relevant portion from by .cabal file executable hellowx-exe hs-

Show Detail

How do I supply a C library to stack on NixOS?

I have a stack-based project that depends on a couple C libraries. One of these C libraries, zlib, is available from a native NixOS package and I can put into the nix section of stack.yaml: nix:

Show Detail

SSH issue during nix-build

Error text: neo@nixos ~/F/nixpkgs> nix-build -A haskellPackages.lambdabot-trusted these derivations will be built: /nix/store/wf447rqgs02yxd4p1lazfzxijmyjc46h-lambdabot-139af15.drv /nix/store/

Show Detail

nix-shell --command `stack build` leads to libpq-fe.h: No such file or directory

i am trying to compile my small project (a yesod application with lambdacms) on nixos. However, after using cabal2nix (more precisely cabal2nix project-karma.cabal --sha256=0 --shell > shell.nix) ,...

Show Detail

`stack build --nix` results in /bin/bash: bad interpreter: No such file or directory

I've previous solved this issue, but I don't remember what I did... So thought I'd post it here to settle it. I'm trying to build a Haskell package with stack build nix, I'm following the answer f...

Show Detail

Is there a way for `stack --nix` to allow newer versions of ghc to be used?

I'm running stack --nix init for a new project (xmonad config) and getting error: attribute 'ghc863' missing, at (string):1:43; I have ghc 8.6.5 in the environment, and stack --version reports: 2.1...

Show Detail