Code::Blocks Forums

User forums => Help => Topic started by: ppanish on April 27, 2012, 05:39:20 pm

Title: Set program's arguments (cmd line arg passing to target) not working in 10.05
Post by: ppanish on April 27, 2012, 05:39:20 pm
I just downloaded/built/installed the stock release (10.05 rev 6282) on Ubuntu Linux 11.10, and I've been unable to pass command line arguments to the target (debug or release doesn't matter). I've set this up using the "Project->Set program's arguments" for both Debug and Release with the box checked for the target providing the main executable. I've read the posts in the Forum without enlightenment. I'm not clear on whether the arguments are supposed to be passed alone, or whether a host application path is needed as a prefix, but I've tried all combinations I could think of without success.

The Build Log Window (which also seems to display the execution log) doesn't show any arguments being passed:

Checking for existence: /home/ppanish/coding/cmdlineargs/cmdline/bin/Debug/cmdline
Executing: xterm -T cmdline -e /usr/local/bin/cb_console_runner LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. /home/ppanish/coding/cmdlineargs/cmdline/bin/Debug/cmdline  (in /home/ppanish/coding/cmdlineargs/cmdline/.)
Process terminated with status 0 (0 minutes, 31 seconds)


Code
#include <iostream>
using namespace std;

int main(int argc, char* argv[]) {
  cout << "argc = " << argc << endl;
  for(int i = 0; i < argc; i++)
    cout << "argv[" << i << "] = "
         << argv[i] << endl;
}

Any help or advice on how to debug this problem would be appreciated.
 

 
Title: Re: Set program's arguments (cmd line arg passing to target) not working in 10.05
Post by: oBFusCATed on April 27, 2012, 06:16:49 pm
If possible try a nightly build. See the nightly build sub forum for details.
It works as expected here.
Title: Re: Set program's arguments (cmd line arg passing to target) not working in 10.05
Post by: ppanish on April 27, 2012, 07:39:54 pm
Thanks, I loaded the trunk rather than the nightly, not sure what difference that will make. It took me a while to install SVN and the necessary libraries, but once that was done it build without problems and took care of my problem.

Much appreciated, I'm looking forward to using this, it looks like an excellent tool.
Title: Re: Set program's arguments (cmd line arg passing to target) not working in 10.05
Post by: oBFusCATed on April 27, 2012, 08:12:17 pm
In fact we have prebuild packages for the nightlies, which are compatible with ubuntu as far as I know