vscode code-runner配置c++编译参数

解决源码和装入文件杂糅。

此命令将自动在源码文件夹下生成bin目录,将编译产生的装入模块放入bin目录并执行。

"code-runner.executorMap":{
  "cpp": "$path=-join ($dir,'\\bin');$exist=Test-Path $path;if ($exist -eq $False) {mkdir $path};cd $dir;$outpath=-join ($path,'/$fileNameWithoutExt'); g++ -std=c++11 $fileName -o $outpath;  ;if ($?){./bin/$fileNameWithoutExt}"
}

须设置vscode默认shell为powershell

posted @ 2020-06-01 10:34  mool  阅读(3049)  评论(1编辑  收藏  举报