CodeRunner Code in VS gives an error?

Good afternoon. Set VS Code and tried to run a simple c++ with code runner, but got krakozyabry in response.
5c99fb0d05cef567118757.png
How to solve this problem?
March 19th 20 at 08:38
2 answers
March 19th 20 at 08:40
VS code is a smart text editor. He can only run a third-party program to build your code but don't collect it yourself. To do so is possible, but difficult. In your case it tries to run python, and it's a different programming language.
The easiest way to Win use Visual Studio Community.
I just switched to another file, the screen changed.
I'm using code runner to run c++, but apparently in the PATH there is no way for the compiler - Albin commented on March 19th 20 at 08:43
@Albin, Yes, cause you got it right. g++ is the compiler that he is trying to run. It can be installed as part of mingw. You can try to get it to work.
Visual Studio Community contains another integrated compiler + debugger, and much more. It is also free and most likely will work without any additional configuration. - Kadin.Parker commented on March 19th 20 at 08:46
@Kadin.Parker, in the section dedicated to the code runner says:
Make sure the executor PATH of each language is set in the environment variable. You could also add entry into code-runner.executorMap to set the executor's PATH. e.g. To set the executor PATH for ruby, php and html:

{
"code-runner.executorMap": {
"javascript": "node",
"php": "C:\\php\\php.exe",
"python": "python",
"perl": "perl",
"ruby": "C:\\Ruby23-x64\\bin\\ruby.exe",
"go": "go run",
"html": "\"C:\\Program Files (x86)\Google\\Chrome\\Application\\chrome.exe\"",
"java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
"c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt"
}
}

I don't know where to stick it - Albin commented on March 19th 20 at 08:49
@Albin, file->preferences->extensions->code runner is likely. There need to specify the path to g++ . But it is not installed automatically. You need to install MinGW. Perhaps he will add to the PATH all that is needed. - Kadin.Parker commented on March 19th 20 at 08:52
March 19th 20 at 08:42
As in the output of solid gibberish, we can only assume that at startup, could not find g++.
Run the same commands from the command line or configure the output encoding in VS Code to cp866 - codepage by default in the command prompt Russian Windows.

Find more questions by tags Visual Studio CodeC++