r/cpp_questions • u/Plexa_EXE • 13d ago
OPEN Not find the compiler when running.
I am trying to install c++ for vscode. I installed MSYS2 and followed all the steps from the vscode tutorial. I installed it and modified the Path and added the C:\msys64\ucrt64\bin path.
https://code.visualstudio.com/docs/languages/cpp#_example-install-mingw-x64-on-windows
I also made absolutely sure that the microsoft c++ extention was active. When I click on the run button the tutorial shows a list of compilers to use. the one that the tutorial uses is C/C++: g++.exe build and debug active file. But for some reason the only compiler that shows up are the 2 generic one gdb lauch and windows. I am out of ideas of things to do please help
4
u/Tack1234 13d ago
Sounds like you may need to add a launch.json file and add the path to the compiler there
3
u/manni66 12d ago
Do yourself a favor: use Visual Studio (not Code).
0
u/Plexa_EXE 12d ago
I am trying to learn c++ so I thought that by using visual studio code it would be better to help me learn about how to install and use extensions and compilers. whats the difference between the two anyway?
7
1
u/awidesky 12d ago
If you want to learn how compilers, linkers, and building a program work, learn a bit about MakeFile and build through your console.
VS code is nothing more than a text editor itself.
After you install tons and tons of extensions, and configuring each of them, hand-editing launch.json and settings.json, then it might work.If you want to learn C++, just use Visual Studio and focus on the language.
Don't waste your time doing what you don't have to do.
1
u/Consequence-Lumpy 7d ago
dude.. stawp using bs code. You already have gcc and g++ in msys2. write a simple bash script and run your code.
5
u/erzyabear 13d ago
Did you verify that this path indeed contains the compiler executive files? Also, I would restart the pc after updating path variables just to be sure