I'm running Nix on WSL with Ubuntu 18.x.
I installed GCC with $ nix-env -i gcc
which installed gcc-7.3.0
.
I'm trying to use GCC to compile a simple CPP file (generated by Ferret). But GCC is coming up with the following error:
$ g++ -std=c++11 -x c++ test_1.cpp -o test_1
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status
It seems that I expected Nix to include common dependencies along with GCC (build-essential
equivalents), which I assume is not true.
Searching using Nix (nix-env -qaP 'gcc'
, nix-env -qaP --description | grep -i gcc
) doesn't provide much help.
Other posts mention installing gcc-multilib
(apt package). The only mention of that in Nix are testing packages:
$ nix-env -qaP --description | grep -i multilib
nixpkgs.tests.cc-multilib-gcc cc-multilib-test
nixpkgs.tests.cc-multilib-clang cc-multilib-test
I'm at a loss as to how to get a build environment working. I cannot find any documentation as to what packages I need to get going. This is pretty simple stuff.