Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/126.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将参数传递给C++;VSCode中的调试程序 < >我想在VSCode中调试一个C++项目(在MAC上,使用GDB或LLDB)。程序本身接受命令行参数,如 ./prog -input cf file_x.txt_C++_Visual Studio Code_Cmdline Args - Fatal编程技术网

将参数传递给C++;VSCode中的调试程序 < >我想在VSCode中调试一个C++项目(在MAC上,使用GDB或LLDB)。程序本身接受命令行参数,如 ./prog -input cf file_x.txt

将参数传递给C++;VSCode中的调试程序 < >我想在VSCode中调试一个C++项目(在MAC上,使用GDB或LLDB)。程序本身接受命令行参数,如 ./prog -input cf file_x.txt,c++,visual-studio-code,cmdline-args,C++,Visual Studio Code,Cmdline Args,当在命令行上启动GDB中的调试会话时,这可以正常工作 在VSCode中,我尝试将launch.json改编为如下内容(仅显示相关行): 这样,我在输出中得到@“Unknown option:\”-input cf\“\r\n”,并且进程没有调试;或者,我只试过这样一个论点: "program": "${workspaceRoot}/build/prog", "args": [ "-input cf path_to/file_x.txt"

当在命令行上启动GDB中的调试会话时,这可以正常工作

在VSCode中,我尝试将
launch.json
改编为如下内容(仅显示相关行):

这样,我在输出中得到
@“Unknown option:\”-input cf\“\r\n”
,并且进程没有调试;或者,我只试过这样一个论点:

"program": "${workspaceRoot}/build/prog",
            "args": [
              "-input cf path_to/file_x.txt"
            ]
产生相同的消息。我错过了什么重要的事情吗?

像这样试试看

"program": "${workspaceRoot}/build/prog",
            "args": [
              "-input",
              "cf",
              "path_to/file_x.txt"
            ]
"program": "${workspaceRoot}/build/prog",
            "args": [
              "-input",
              "cf",
              "path_to/file_x.txt"
            ]