Skip to content

GHCup-installed cabal can't find existing C libraries

I have a small project (it's pinned on the bottom), which requires nanovg and sdl2 Haskell packages.

I had already run a GHC dev dependencies script (which is created after GHCup installs), and installed the following libraries to MINGW64:

  • mingw-w64-x86_64-SDL2
  • mingw-w64-x86_64-glew
  • mingw-w64-x86_64-cmake
  • mingw-w64-x86_64-autotools
  • mingw-w64-x86_64-nanovg
  • mingw-w64-x86_64-freeglut

After that I tried to build the project and got this:

Failed to build nanovg-0.8.0.0. The failure occurred during the configure step.
Build log ( C:\Haskell\cabal\logs\ghc-8.10.7\nanovg-0.8.0.0-e8bb5743ba6fc983421f00e4f45cd6b1f292834e.log ):
Configuring library for nanovg-0.8.0.0..
cabal-3.6.2.0.exe: The pkg-config package 'glew' is required but it could not be found.

Failed to build sdl2-2.5.3.2. The failure occurred during the configure step.
Build log ( C:\Haskell\cabal\logs\ghc-8.10.7\sdl2-2.5.3.2-70d889520ed5ebfe9b4048d4b870c7f255b5d63b.log ):
Configuring library for sdl2-2.5.3.2..
cabal-3.6.2.0.exe: The pkg-config package 'sdl2' version >=2.0.10 is required but it could not be found.

cabal-3.6.2.0.exe: Failed to build nanovg-0.8.0.0 (which is required by exe:app from MP3-Metadata-0.1.0.0). See the build log above for details.
Failed to build sdl2-2.5.3.2 (which is required by exe:app from MP3-Metadata-0.1.0.0). See the build log above for details.

Both logs were just a copy of console output. I have no idea what went wrong.

The main reason why I'm writing here is that clean installation of Stack with all listed earlier C libraries installed via stack exec -- pacman -S builds and runs this project without any problems.

I guess there is a problem with MSYS2 visibility, because GHCup-installed Stack, which was configured to use the system installations of GHC and MSYS2, encountered the same problem.

Thanks in advance.

P.S. here is the project: MP3-Metadata.zip

Edited by Dmitriy Vashurin
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information