How can I resolve a 'linker cc not found' error when building a NixOS package?

Question

Grade: Education Subject: Support
How can I resolve a 'linker cc not found' error when building a NixOS package?
Asked by:
78 Viewed 78 Answers

Answer (78)

Best Answer
(349)
You can resolve this by ensuring the `gcc` and `binutils` packages are installed in your NixOS system. Add `gcc` and `binutils` to your `environment.systemPackages` in your `configuration.nix` file. For example: `environment.systemPackages = with pkgs; [ gcc binutils ];` Then, rebuild your system or the specific package that's failing to build.