News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

How do I pass a file as a command line argument in Debug?

Started by mfcummings, February 18, 2010, 05:56:46 PM

Previous topic - Next topic

mfcummings

Hello,

I want to debug a program that I'm having problems with.  Rather than restructure the whole program to bypass the initial specifications, I was hoping to discover a way to pass a file as an argument in debug mode.  I have a simple console project that parses a text file, I tried Project-> "Set Programs Arguments..." and included the name of the text file with all of the possible variations (highlighting "Debug" & "Release", check/uncheck "This target provides..", putting the file name in quotes, etc.) to no avail.

I'm using Code::Blocks v. 8.02 on Win7 using a simple notepad .txt file as an input parameter.

Please advise, Thanks for your input.

MFC

MortenMacFly

Quote from: mfcummings on February 18, 2010, 05:56:46 PM
Please advise, Thanks for your input.
Did you ensure that you setup the path to execute the application correctly in the project settings for your debug target?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

mfcummings

I did not, but with your suggestion I added the complete path.  When that didn't work, I wrapped the full path in quotations and that did work!

Thank you for your suggestion, you solved my problem and now I can concentrate on more productive troubleshooting.   :D