Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: archwndas on December 31, 2011, 02:06:19 pm

Title: Passing command-line arguments
Post by: archwndas on December 31, 2011, 02:06:19 pm
Dear all,

I start a console project. Unfortunately I cannot pass
command line arguments. I googled around and I even
searched this forum for similar posts. The guidlines do
not work. In my case the child window for passing command
line arguments doesn't have a line-edit (in qt terminology)
to pass arguments under the corresponding label.



I have the latest code-blocks 10.05.
Title: Re: Passing command-line arguments
Post by: oBFusCATed on December 31, 2011, 02:12:28 pm
Have you tried Project->Set program's arguments?
Title: Re: Passing command-line arguments
Post by: archwndas on December 31, 2011, 02:42:36 pm
Have you tried Project->Set program's arguments?

Take a look at the attached file. Of course I tried it.
There in nowhere to put them in the child window.
I mentioned that already. But to clear things up and
be more precise, I have attached the window itself,
so you can see for yourselves that there is nowhere
to pass the arguments.
Title: Re: Passing command-line arguments
Post by: oBFusCATed on December 31, 2011, 03:02:29 pm
Ah, the ubuntu problem, see here for details: http://forums.codeblocks.org/index.php/topic,15516.0.html

The easiest way to fix this is to use a nightly build from apt.jenslody.de (http://apt.jenslody.de)
Also you can report this to the maintainer of C::B in ubuntu, so he can patch it and then you can use 10.05 instead of a nightly build.

This is the change:
Quote
http://svn.berlios.de/wsvn/codeblocks?op=comp&compare[]=%2Ftrunk%2Fsrc%2Fsdk%2Fresources%2Fselect_target.xrc@7544&compare[]=%2Ftrunk%2Fsrc%2Fsdk%2Fresources%2Fselect_target.xrc@7579
Title: Re: Passing command-line arguments
Post by: archwndas on December 31, 2011, 05:33:01 pm
Quote
I've just fixed it yesterday. It will be in the next nightly or you could apply the patch yourself (I've done so:) ).
Just replace the file in the /usr/share/codeblocks/manager_resources.zip and it the problem will be gone.

Sorry but the suggestion above doesn't help. What is missing is the "file" (what file, which, were?).
And of course where this file can be downloaded.

Furthermore, about the night builds.

After installing the extra lines in  /etc/apt/sources.list and running
apt-get update
There are a few options that appear, but it is not clear what to install.
So, it is a dead end for me.

I do not know what to do. Could you please help a bit?
Title: Re: Passing command-line arguments
Post by: stahta01 on December 31, 2011, 07:04:34 pm
Are you positive you built an executable instead of building a library?

Tim S.
Title: Re: Passing command-line arguments
Post by: Jenna on December 31, 2011, 08:23:46 pm
After installing the extra lines in  /etc/apt/sources.list and running
apt-get update
There are a few options that appear, but it is not clear what to install.
So, it is a dead end for me.

I do not know what to do. Could you please help a bit?


Try
Code
sudo apt-get install codeblocks codeblocks-contrib
Title: Re: Passing command-line arguments
Post by: archwndas on January 01, 2012, 04:21:59 pm
Quote
Code
sudo apt-get install codeblocks codeblocks-contrib

Code
$ sudo apt-get install codeblocks codeblocks-contrib
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 codeblocks : Depends: libcodeblocks0 (= 10.05svn7639-1) but 10.05-2 is to be installed
              Depends: libwxbase2.8-0 (>= 2.8.12.1) but 2.8.11.0-0ubuntu10 is to be installed
              Depends: libwxgtk2.8-0 (>= 2.8.12.1) but 2.8.11.0-0ubuntu10 is to be installed
 codeblocks-contrib : Depends: libwxbase2.8-0 (>= 2.8.12.1) but 2.8.11.0-0ubuntu10 is to be installed
                      Depends: libwxgtk2.8-0 (>= 2.8.12.1) but 2.8.11.0-0ubuntu10 is to be installed
                      Depends: libwxsmithlib0 (= 10.05svn7639-1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Title: Re: Passing command-line arguments
Post by: Jenna on January 01, 2012, 04:58:17 pm
It seems you did not read the notes for ubuntu users on my site (http://apt.jenslody.de/).
Title: Re: Passing command-line arguments
Post by: archwndas on January 01, 2012, 06:40:36 pm
OK now it works, but I found another bug.

Valgrind does not understand the
Execution working dir

I went to:

Project->Properties->Build Options

and modified the execution working directory, because I have some input
files using relative paths. When I run the executable normally, everything
is fine. But the valgrind (memcheck) doesn't seem to understand that the
Execution working directory has been modified.

Is that easy to fix?
Title: Re: Passing command-line arguments
Post by: oBFusCATed on February 18, 2012, 01:11:16 am
archwnds: This bug should be fixed in trunk.