1

I want to install g++ so I can compile and run C++ code in VScode.

I started by trying to follow the VSCode-provided guide which states I need to install mysys.

I tried installing msys2 per the given instructions, but running g++ --version in Command Prompt returned 'g++' is not recognized.

I then tried adding C:\msys64\mingw64\bin to the Path variable under 'User Variables for Solebay' (Windows 11, System>About>Advanced System Settings>Environment Variables). g++ was still not found.

Second approach:

As seen here I tried unzipping MinGW64.zip directly into C:\ as well as adding C:\MinGW64\bin to my path. Again, g++ is not recognised.

This was easy on Ubuntu but I'm lost with Windows. What on earth am I doing?

1 Answer 1

1

You have to run..

pacman -S --needed base-devel mingw-w64-x86_64-toolchain

..in msys after it is installed.

You may need to start a new project or restart the computer to instigate changes in VScode.

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Apr 27, 2022 at 14:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .