`.so` dependencies of `gd` library have `undefined reference` errors


I have a Flake using haskell.nix: GitHub - input-output-hk/haskell.nix: Alternative Haskell Infrastructure for Nixpkgs

The devShell is defined here: hackage-server/flake.nix at 8794c621fb8aa6d71de38115652a4f03f56b82bf · haskell/hackage-server · GitHub

I am having difficulty with the library gd: NixOS Search
Its dependencies such as libjpeg, libpng, libtiff, libavif, etc. are specified: hackage-server/flake.nix at 8794c621fb8aa6d71de38115652a4f03f56b82bf · haskell/hackage-server · GitHub

In the devShell, cabal build all --enable-tests produces errors like:

undefined reference to `kYvu2020Constants'

undefined reference to `lzma_stream_encoder@XZ_5.0'

collect2: error: ld returned 1 exit status

Furthermore, LD_LIBRARY_PATH is specified:

LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;

Any ideas? Thank you

I should have looked higher in the output, there were more warnings about missing libraries:


On to the next issue

Any ideas? Thx

undefined reference to `std::basic_ios<char, std::char_traits<char> >::clear(std::_Ios_Iostate)@GLIBCXX_3.4'

Isolated example here: failure to build `gd` Hackage library in `nix develop` shell · Issue #1865 · input-output-hk/haskell.nix · GitHub

Sounds suspiciously similar to build-support/cc-wrapper: revert "pass in non-existent --sysroot= to … by trofi · Pull Request #213185 · NixOS/nixpkgs · GitHub. Does your nixpkgs input contain the fix?

1 Like

are you locked into IOHK’s haskell.nix or do have the options are using something else?

1 Like

no, I’ve also considered GitHub - srid/haskell-flake: A flake-parts Nix module for Haskell development which is apparently leaner and newer

I haven’t gotten the pinned hackagePackages correct with that, yet, but it looks like a promising alternative

maybe give https://horizon-haskell.net/

It may fit your needs.

These two alternatives, try to be much cleaner and simpler!

1 Like