名称具有空格的文件未编译

the files with their name having space are not getting compiled

本文关键字:文件 编译 空格      更新时间:2023-10-16

使用 vscode 编译我的 C++ 程序。 名称具有空格的文件未编译

"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "shell: g++.exe build active file",
"command":"C:\Program Files (x86)\CodeBlocks\MinGW\bin\g++.exe",
"args": ["-g", "${file}", "-o", "${fileDirname}\${fileBasenameNoExtension}.exe", "-std=c++11"],
"options": {
"cwd":"C:\Program Files (x86)\CodeBlocks\MinGW\bin"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}```

就是这样。Chekcout VSCode 用于编译和运行和 c++ 文件的命令:

cd "c:UsersDeep RavalDesktop" ; if ($?) { g++ -std=c++14 garbage 2.cpp -o garbage 2 } ; if ($?) { .garbage 2 }

更具体地说,间隔文件会造成天气混乱,它是命令或实际文件名。

要解决此问题,您可以使用_而不是space

或者,您可以根据操作系统设计自定义命令。