Code::Blocks
July 29, 2010, 05:55:14 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New release 10.05 is ready. Grab it while it's hot!!!
 
   Home   Help Search Login Register  :: WebsiteWiki  
Pages: [1]
  Send this topic  |  Print  
Author Topic: "Set program's arguments - Host application" doesn't work  (Read 697 times)
oBFusCATed
Lives here!
****
Posts: 1081


« on: March 14, 2010, 12:11:26 am »

Hello,
I have a problem with the host application option/setup.

Steps:

1. Create console project (named "console") and place it somewhere on disk
1.1. Build project
2. Create shared lib project (named "library") and place it at the same path as the console project ( console.cbp and library.cbp are in the same directory)
2.1. Build project
3. Set the "library" as active project
4. Click Project -> Set program's arguments -> Debug -> Browse -> Choose the debug executable generated for "console" project ( "bin/debug/console")
5. Hit "Build & Run"

The result is this:
Code:
Checking for existence: /home/obfuscated/projects/tests/host_app/test2/bin/debug/liblibrary.so
Executing: bin/debug/console  (in /home/obfuscated/projects/tests/host_app/test2/.)
Process terminated with status 127 (0 minutes, 0 seconds)

Here is the zipped project : http://smrt.is-a-geek.org/codeblocks/test2.zip
I'm seeing this on gentoo linux amd64, C::B 6185 debugger branch (trunk has the same problem).

Logged
jens
Global Moderator
Lives here!
*****
Posts: 2975



WWW
« Reply #1 on: March 14, 2010, 10:01:55 am »

The problem seems to be that the working dir of the debugger is always set to the projects root-dir, not to the executing working dir you have selected in the properties.

A workaround for the moment:
use bin/release or bin/debug (in your case) as executing working dir, and ./console (for release) and bin/debug/console (for the debug target) as host application.

So running the host app works with the run-button for the release-target and with the debugger (but not the run-button) for the debug-target.

It should be not so hard to fix this, I will look into it.
Logged

Regards

Jens

debian - nightlies and wxWidgets (msw-)cross-build libs for "i386" and "amd64" : http://apt.jenslody.de/
C::B changelog: http://apt.jenslody.de/ChangeLog
jens
Global Moderator
Lives here!
*****
Posts: 2975



WWW
« Reply #2 on: March 14, 2010, 11:29:04 am »

A much ore simple solution:
leave everything as it is and add the directory where the library is created to the linker search-dirs.
The linker search directories are added to the search-path for dynamic libraries, and so the library can be found by the executable.
Logged

Regards

Jens

debian - nightlies and wxWidgets (msw-)cross-build libs for "i386" and "amd64" : http://apt.jenslody.de/
C::B changelog: http://apt.jenslody.de/ChangeLog
oBFusCATed
Lives here!
****
Posts: 1081


« Reply #3 on: April 06, 2010, 09:43:06 pm »

The problem seems to be that the working dir of the debugger is always set to the projects root-dir, not to the executing working dir you have selected in the properties.
Should I implement this in the debugger branch?

A workaround for the moment:
use bin/release or bin/debug (in your case) as executing working dir, and ./console (for release) and bin/debug/console (for the debug target) as host application.
I don't fully understand, unfortunately Sad

A much ore simple solution:
leave everything as it is and add the directory where the library is created to the linker search-dirs.
The linker search directories are added to the search-path for dynamic libraries, and so the library can be found by the executable.
I think, I've tested this and it haven't worked Sad

p.s. is this linux/unix only issue?
Logged
Pages: [1]
  Send this topic  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!