当一个C++文件形成时,让“new.cpp”在vs代码中执行,然后形成另一个文件“new.exe”,但在我的vs代码中它只形成一个名为“new”的文件,没有扩展名。如何纠正?
我尝试更改tasks.json,但无法弄清楚。
您可以提供构建日志或您的
tasks.json
文件吗?它应该是这样的:
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++.exe build active file",
"command": "C:\\msys2\\mingw64\\bin\\g++.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${workspaceFolder}\\main.cpp", // Your source file
"-o",
"${workspaceFolder}\\main.exe" // This is what the output exe is called
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}