Skip to content
Advertisement

Installing g++ on windows subsystem for linux

A while back I activated Windows Subsystem for Linux on my machine but didn’t use it much. Now I have an idea what I could use it for and that is why I’m trying to install gcc/++ 7 on my WSL and keep running into problems.

My idea was to download it and compile it by hand following this guide with:

JavaScript

This led to the following error:

JavaScript

Apparently, there was no(?) gcc installed at all. At least gcc and cc yielded “command not found”. So my next step was installing gcc via:

JavaScript

This worked:

JavaScript

However when trying the configure command from above I got:

JavaScript

So I tried to compile a simple c program by hand:

JavaScript

Which hints that something seems to be seriously broken

JavaScript

Any Ideas where I can even start to repair this? I wouldn’t even mind reseting the whole WSL if this helps :/

JavaScript

UPDATE:

Before all of this I tried installing gcc7 / g++/ via apt without success:

JavaScript

UPDATE 2

Sadly none of the suggested ways helped and I ended up nuking the WSL. Apparently, something more severe was broken.

Advertisement

Answer

Why compiling? You should be able to install the package:

JavaScript

Verify using:

JavaScript

See How to install gcc-7 or clang 4.0?

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement