Описание
После установки MSYS2 для Windows и попытки использовать LanguageServer в режиме GCC IntelliSense возвращается в режим Win64 по умолчанию с в окне вывода расширения отображается следующая ошибка:
DEBUG CONSOLE
Код: Выделить всё
Starting: "F:\code_software\msys2\ucrt64\bin\g++.exe" --interpreter=mi
g++.exe: error: unrecognized command-line option '--interpreter=mi'
g++.exe: fatal error: no input files
compilation terminated.
"F:\code_software\msys2\ucrt64\bin\g++.exe" exited with code 1 (0x1).
Код: Выделить всё
Starting build...
cmd /c chcp 65001>nul && F:\code_software\msys2\ucrt64\bin\g++.exe -fdiagnostics-color=always -g F:\Linux\cpp_practice\hello.cpp -o F:\Linux\cpp_practice\hello.exe
Build finished successfully.
* Terminal will be reused by tasks, press any key to close it.
Windows 11
Код VS: 1.89.1
Версия расширения C/C++: 1.20.5< /p>
task.json
Код: Выделить всё
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++.exe build active file",
"command": "F:\\code_software\\msys2\\ucrt64\\bin\\g++.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
Код: Выделить всё
{
"configurations": [
{
"name": "C/C++: g++.exe build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "F:\\code_software\\msys2\\ucrt64\\bin\\g++.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++.exe build active file"
}
],
"version": "2.0.0"
}
Код: Выделить всё
#include
#include
#include
using namespace std;
int main()
{
vector msg{"Hello", "C++", "World", "from", "VS Code", "and the C++ extension!"};
for (const string &word : msg)
{
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/78550738/starting-f-code-software-msys2-ucrt64-bin-g-exe-interpreter-mi-g-exe[/url]