本文主要是介绍vscode调试时如何在launch.json中添加环境变量,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
"configurations": [{"name": "g++ - 生成和调试活动文件","type": "cppdbg","request": "launch","program": "************************","args": ["**************************"],"stopAtEntry": false,"cwd": "*****************************","environment": [{"name": "PYTHONPATH", "value": "/home/hl/code/DeConvV2/"}],"externalConsole": false,"MIMode": "gdb","setupCommands": [{"description": "为 gdb 启用整齐打印","text": "-enable-pretty-printing","ignoreFailures": true}],"preLaunchTask": "C/C++: g++ build active file","miDebuggerPath": "/usr/bin/gdb"}]
更多常用参数的解释和示例,参考
vscode调试时几个常用参数的含义和设置总结_子燕若水的博客-CSDN博客request#指示配置节是要启动程序还是要连接到已在运行的实例。Indicates whether the configuration section is intended tolaunchthe program orattachto an already running instance.args#启动程序时传递给程序的命令行参数的JSON数组。JSON array of command-line arguments to pass to the program whe...https://blog.csdn.net/u010087338/article/details/121282932
这篇关于vscode调试时如何在launch.json中添加环境变量的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!