Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libstdc++.so.6 not available in template #76

Open
hknlof opened this issue Feb 3, 2025 · 0 comments
Open

libstdc++.so.6 not available in template #76

hknlof opened this issue Feb 3, 2025 · 0 comments

Comments

@hknlof
Copy link

hknlof commented Feb 3, 2025

Not a C++ developer. I assume enough C and especially C++ developers use libstdc++.so.6. When building a project, which downstream depends on it, I receive the following failure:

ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory

Hence, it might make sense to add the LD_LIBRARY_PATH?

Full flake.nix:

{
  description = "A Nix-flake-based C/C++ development environment";

  inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";

  outputs = { self, nixpkgs }:
    let
      supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
      forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
        pkgs = import nixpkgs { inherit system; };
      });
    in
    {
      devShells = forEachSupportedSystem ({ pkgs }: {
        default = pkgs.mkShell.override {} {
            packages = with pkgs; [
              clang-tools
              cmake
              codespell
              conan
              cppcheck
              doxygen
              gtest
              lcov
              vcpkg
              vcpkg-tool
            ];
            # Change, that worked and as far as I understand would not violate the nix-way
            # https://discourse.nixos.org/t/how-to-solve-libstdc-not-found-in-shell-nix/25458/16
            LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ pkgs.stdenv.cc.cc ];
          };
      });
    };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant