简体   繁体   English

在Visual Studio中使用命令行输入文本进行调试

[英]Debugging with command-line input text in visual studio

I have C++ multi project, in visual studio 2012, from which a .exe file is generated and there is a huge config.txt file contains many input arguments. 我在Visual Studio 2012中有一个C ++多项目,从中生成一个.exe文件,并且有一个巨大的config.txt文件,其中包含许多输入参数。 So I run my program by this command in command line of windows: program.exe -c config.txt 因此,我通过以下命令在Windows命令行中运行程序: program.exe -c config.txt

Now I want to debug this program but I can't give it the config.txt as an input argument file. 现在,我想调试该程序,但无法将config.txt作为输入参数文件提供给它。 I tried the answers of Debugging with command-line parameters in Visual Studio 在Visual Studio中尝试了使用命令行参数进行调试的答案

but it didn't mentioned how to give the whole .txt file to visual studio instead of typing arguments in properties->debugging->command argument 但是它没有提到如何将整个.txt文件提供给Visual Studio,而不是在properties-> debugging-> command参数中键入参数

in config.txt I have arguments like this : 在config.txt中,我有这样的参数:

-numberOfImage 2 ./Lena.jpg ./Barbara.jpg

-imageDimensions 230 230

-minIntensity 0

-maxIntensity 255

and more many inputs which I want to change them easily in .txt file not typing them in command argument. 以及更多我想在.txt文件中轻松更改它们的输入,而不是在命令参数中键入它们。 How can I link config.txt to debugger? 如何将config.txt链接到调试器?

You can: 您可以:

  1. Hardcode the name of the file 硬编码文件名

  2. use the input stream to give another file name 使用输入流提供另一个文件名

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Visual Studio 中使用命令行参数进行调试 - Debugging with command-line parameters in Visual Studio 快速输入命令行参数进行 Visual Studio 调试? - Quickly enter command-line parameters for Visual Studio debugging? Visual Studio:命令行错误D8016:'/ Ox'和'/ RTC'命令行选项不兼容 - Visual Studio: Command line error D8016: '/Ox' and '/RTC' command-line options are incompatible Visual Studio:管理应用程序的调试命令行参数 - Visual Studio: Manage debugging command line arguments for the app Visual Studio错误D8016:'/ ZI'和'/ O2'命令行选项不兼容 - Visual Studio error D8016: '/ZI' and '/O2' command-line options are incompatible Visual Studio 错误 D8016:“/ZI”和“/Gy”命令行选项不兼容 - Visual Studio error D8016: '/ZI' and '/Gy' command-line options are incompatible 如何从命令行编译 Visual Studio 项目? - How do I compile a Visual Studio project from the command-line? Eigen程序无法从Visual Studio编译,但是编译从命令行成功 - Eigen program failing to compile from Visual Studio, but compilation succeeds from the command-line 是否有一个命令行工具可以复制Visual Studio的C ++自动识别样式? - Is there a command-line tool that copies visual studio's C++ auto-ident style? 在Visual Studio 2005中编译Win32“hello world”的命令行 - Command-line to compile Win32 “hello world” in Visual Studio 2005
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM