I'm using Code Runner extension in VS Code to run C++ code and it's using the wrong terminal command to do so. I'm using git-bash in VS Code and Windows 10.
This is the command in terminal:
Douglas@LAPTOP-6BSNLLDB MINGW64 /c/path (master)
$ cd "c:\path\" && g++ HelloWorld.cpp -o HelloWorld && "c:\path\"HelloWorld
bash: cd: c:\path" && g++ HelloWorld.cpp -o HelloWorld && c:path"HelloWorld: No such file or directory
As you can see, it's using cd
and g++
correctly, but the command to actually run the .exe
file is wrong.
Shouldn't it be "c:\path\HellowWorld.exe"
?
How can I change this? It works correctly with python.
If I can't, how do I run C++ code within VS Code?