category feed“Missing dependency on a foreign library”Troubleshootingeditdelete

This category is a work in progress






When a non-Haskell library is required but either isn't installed or is installed to a weird path, you will see the following error:

    Configuring cryptonite-openssl-0.6...
    Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2: Missing dependency on a foreign
    library:
    * Missing C library: crypto
    This problem can usually be solved by installing the system package that
    provides this library (you may need the "-dev" version). If the library is
    already installed but in a non-standard location then you can use the flags
    --extra-include-dirs= and --extra-lib-dirs= to specify where it is.

Here we compile the list of libraries and corresponding distro packages so that you would know what package you need to install to get a particular library.

edit description
or press Ctrl+Enter to savemarkdown supported
#
Missing C library: crypto
other
move item up move item down edit item info delete item
Summary edit summary
  • Ubuntu: apt install libssl-dev

  • Fedora: dnf install openssl-devel

Summary quit editing summary
#
Missing C library: rocksdb
other
move item up move item down edit item info delete item
Summary edit summary
  • Ubuntu: apt install librocksdb-dev

  • Arch: install rocksdb from AUR (you should also install jemalloc first because RocksDB is more stable when compiled with jemalloc)

Summary quit editing summary
#
Missing C libraries: eay32, ssl32
other
move item up move item down edit item info delete item
Summary edit summary

This one usually appears on Windows. The solution is to install OpenSSL (here's an installer for Windows) and point GHC to it: --extra-include-dirs=/c/OpenSSL-Win64/include --extra-lib-dirs=/c/OpenSSL-Win64.

Summary quit editing summary
#
Missing C library: z
other
move item up move item down edit item info delete item
Summary edit summary
  • Fedora: dnf install zlib-devel
  • Ubuntu: apt install zlib1g-dev
Summary quit editing summary
#
Missing C library: stdc++
other
move item up move item down edit item info delete item
Summary edit summary
  • Fedora: dnf install gcc-c++

  • Alpine: apk add g++

Summary quit editing summary
#
Missing C library: lzma
other
move item up move item down edit item info delete item
Summary edit summary
  • Fedora: dnf install xz xz-devel (yes, not lzma-devel)

  • Ubuntu: apt install liblzma-dev

Summary quit editing summary
#
configure: error: curses library not found, so this package cannot be built
other
move item up move item down edit item info delete item
Summary edit summary
  • Fedora: dnf install ncurses-devel
Summary quit editing summary
#
Missing C library: uuid
other
move item up move item down edit item info delete item
Summary edit summary
  • Ubuntu: apt install uuid-dev
Summary quit editing summary
#
Missing C library: pq
other
move item up move item down edit item info delete item
Summary edit summary
  • Ubuntu: apt install libpq-dev
Summary quit editing summary
#
Missing C libraries: icuuc, icui18n, icudata
other
move item up move item down edit item info delete item
Summary edit summary
  • Ubuntu: apt install libicu-dev

  • macOS: brew install icu4c. Then, if you're using Stack, add to your ~/.stack/config.yaml:

    extra-include-dirs:
    - /usr/local/opt/icu4c/include
    
    extra-lib-dirs:
    - /usr/local/opt/icu4c/lib
Summary quit editing summary
#
"setup: Can't find OpenSSL library" or "Missing (or bad) header file: openssl/evp.h"
other
move item up move item down edit item info delete item
Summary edit summary
  • macOS: brew install openssl. Then, if you're using Stack, add to your ~/.stack/config.yaml:

    extra-include-dirs:
    - /usr/local/opt/openssl/include
    
    extra-lib-dirs:
    - /usr/local/opt/openssl/lib
Summary quit editing summary