VsCode控制面板中执行一个文件之后,如果新建了f90文件(多程序共用一个面板的端口),往往会出现如图所示的报错
解决办法
tasks.json文件应添加presentation属性`
{
"version": "2.0.0",
"tasks": [
{
"label": "compile",
"type": "shell",
"command": "gfortran",
"args": [
"-g",
"${file}",
"-o",
"${workspaceRoot}\\${fileBasenameNoExtension}.exe"
],
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "new", //这里shared表示共享,改成new之后每个进程创建新的端口
"showReuseMessage": true,
"clear": false
}
}
]
}
“shared“表示共享,改成new之后每个进程创建新的端口。