vscode 报错command line option ‘-std=c11‘ is valid for C/ObjC but not for C++
cc1plus.exe: warning: command-line option '-std=c17' is valid for C/ObjC but not for C++
编译运行出现警告,原因是在task.json配置使用gcc编译器,而在c++需要使用g++,不然报错。
tasks": [
{
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe",
"-std=c17"
],
"command": "C:\\msys64\\mingw64\\bin\\g++.exe",

浙公网安备 33010602011771号