Having Trouble Sourcing Mingw

Hi everyone. I’m new to Codecadamy and really loving it. Trying to learn C++ and made it to the part where you need to download mingw: https://www.codecademy.com/courses/learn-c-plus-plus/articles/cpp-compile-execute-locally

I followed the link to https://www.msys2.org downloaded and installed MYSYS2 (msys2-x86_64-20220118.exe) but nothing really looks like it does in the tutorial video.

  1. In the tutorial, command prompt appears to be running in file explorer, but for me it opens as a separate black window.

  2. I’ve installed MYSYS2 but when I type g++ into command prompt, it still says it’s missing: g++ is not recognized as an internal or external command, operable program or batch file.

  3. I’ve followed the course up to this point but I don’t have a file on desktop called hello, like there is in the tutorial video.

I’m just feeling really uncertain about whether I’ve installed the right thing and how to set it up correctly. I’d really appreciate some further guidance.

I’m running it on Windows 11 (I know, don’t say anything…).

1 Like

Unfortunately it has always been a little more work on Windows.

Regarding the tutorial the command prompt is definitely a different window, in their example they’re simply set it up to have a white background and black text which is the opposite to the default style but it’s only a style change. It’s the same program.

If you’ve followed the install steps then after the installation there should’ve been mention about finding the MinGW folder on your hard drive and making sure there’s a bin folder with the relevant executable in it. That bin folder needs to be added to your PATH (I believe the video goes through this) then the current cmd window should be closed and reopened to check it works correctly.

There are other routes to get this sorted, e.g. VisualStudio or using WSL but that’s shifting the goalposts. See if you can get it to work this way before choosing another. If it’s still troubling consider having a web search for some install videos, e.g. on YT which you might find easier to follow.

1 Like

Hiya. Thanks for getting back to me.

So, in the tutorial video, when he downloads Mysys, he gets a pop-up that allows him to choose what to install, and there’s an option for mingw32-gcc-g+±bin, but I didn’t get that pop-up. I have a Mysys folder on my computer now, with subfolders containing applications for mingw32, mingw64 and mysys2. All of these appear to open the same source code compiler window, where the prompt is a dollar sign $, but there’s nothing obvious that seems to relate to g++ and command prompt still says I don’t have it. How do you get to the mingw manager to select mingw32-gcc-g+±bin?

1 Like

I couldn’t say for sure, I’m afraid I didn’t use msys when setting up so I’m not sure what prompt shows up. I’d highly suggest viewing the msys documentation for getting started/installs though. It sounds like the set-up has changed since that video was made.

On their website it looks like they’re now using the pacman package management tool instead of a GUI window. Definitely worth double-checking the guidance straight from the group in that case (but that is speculation, I haven’t tried so good luck :slightly_smiling_face:).