今天在windows 尝试使用vscode
使用g++ 编译
结果总是出现 error g++ " '-Wall' " not such file and directory 错误。
后来搞不定就没管它。
查了下stackoverflow 的网站,得到一些启发。
原来是 符号写错了。下面用红色标出。
"label": "g++.exe build active file", // 任务的名字叫Build,注意是大小写区分的,等会在launch中调用这个名字
"type": "shell", // 任务执行的是shell命令,也可以是
"command": "g++", // 命令是g++
"args": [
"'-Wall'", // 因为复制的csdn 代码,多打了一对单引号
"-g",
"-std=c++17", //use c++17 编译
"${workspaceRoot}/main.cpp",
//"'${file}'", //当前文件名
"-o", //对象名,不进行编译优化
"${fileBasenameNoExtension}.exe", //当前文件名(去掉扩展名)
],