I’m trying to build console app with a framework that uses Curses and I’m getting this error:
Error loading native library "libncursesw.so.6, libncursesw.so.5"
I’ve tried using nix-index and nix-locate to find these libraries and they are present in ncurses
package. But adding it to shell packages doesn’t help. The only thing that did help was building FHS environment.
Please help me understand is that a problem with something I’m doing or with how ncurses or dotnet are packaged. Whichever that is can I do something to avoid using buildFHSEnv
(since it won’t work on certain machines)?
Here’s everything to reproduce the error I’m getting
./project.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
./Program.cs
using Unix.Terminal;
Curses.initscr()
./flake.nix
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
outpus = inputs:
let
system = "x86_64-linux";
pkgs = import inputs.nixpkgs { inherit system; };
in
{
devShells.${system}.default = pkgs.mkShell {
name = "dotnet-env";
packages = [
pkgs.dotnet-sdk_8 # or:
# pkgs.dotnetCorePackages.sdk_8_0
pkgs.ncurses # or:
# pkgs.ncursees.dev
];
};
};
}