Author Topic: Passing command-line arguments  (Read 9455 times)

Offline archwndas

  • Single posting newcomer
  • *
  • Posts: 5
Passing command-line arguments
« 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.
« Last Edit: December 31, 2011, 02:40:39 pm by archwndas »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Passing command-line arguments
« Reply #1 on: December 31, 2011, 02:12:28 pm »
Have you tried Project->Set program's arguments?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline archwndas

  • Single posting newcomer
  • *
  • Posts: 5
Re: Passing command-line arguments
« Reply #2 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Passing command-line arguments
« Reply #3 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
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
« Last Edit: December 31, 2011, 03:06:09 pm by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline archwndas

  • Single posting newcomer
  • *
  • Posts: 5
Re: Passing command-line arguments
« Reply #4 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?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7589
    • My Best Post
Re: Passing command-line arguments
« Reply #5 on: December 31, 2011, 07:04:34 pm »
Are you positive you built an executable instead of building a library?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Passing command-line arguments
« Reply #6 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

Offline archwndas

  • Single posting newcomer
  • *
  • Posts: 5
Re: Passing command-line arguments
« Reply #7 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.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Passing command-line arguments
« Reply #8 on: January 01, 2012, 04:58:17 pm »
It seems you did not read the notes for ubuntu users on my site.

Offline archwndas

  • Single posting newcomer
  • *
  • Posts: 5
Re: Passing command-line arguments
« Reply #9 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?
« Last Edit: January 02, 2012, 05:06:59 pm by archwndas »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Passing command-line arguments
« Reply #10 on: February 18, 2012, 01:11:16 am »
archwnds: This bug should be fixed in trunk.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]