报错:
现象:
可以编译源程序,但是不能运行生成的exe。
原因:
VsCode不能运行带中文名的exe,路径中带中文也不可以(绝对名称?)。 打印的是变量program的信息,program就是保存要运行的程序的地址。
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "g++.exe build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
// "program": "E\\计科的文件\\代码\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",