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",

 

 
posted @ 2022-10-18 23:35  初冬又十三  阅读(2115)  评论(0)    收藏  举报