User forums > Using Code::Blocks

Executable running while it should not (Nightly - Windows)

(1/3) > >>

jeancf:
Hi,

I am trying to understand the behaviour of C::B with the app that I am currently working on. I compiled and dynamically linked my .exe with a library that is not on the system PATH nor in the current directory and yet, when I start the app from the IDE, it runs instead of complaining that it can't find the DLL.

myapp.exe is in C:\dev\myproject\bin
mylibrary.dll is in C:\dev\some_library\lib

When I try to run the app from the command line though, I get the expected error message.

I searched the configuration screens of C::B and my project but I could not find any explanation of why it is doing this but I would prefer to disable that behaviour if possible.

Thanks,

/~jc

mandrav:

--- Quote from: jeancf on July 06, 2007, 10:35:54 am ---I searched the configuration screens of C::B and my project but I could not find any explanation of why it is doing this but I would prefer to disable that behaviour if possible.

--- End quote ---

The linker search paths are used in PATH (for windows), LD_LIBRARY_PATH (for linux) and DYLD_LIBRARY_PATH (for mac) when you run your program.
This is (IMO) a nice feature and I must say I 'm surprised that you want this disabled. It's only there to make you (development) life a little easier.

jeancf:
Thanks for your reply.

I suspected something like that.

I now checked under Linux (gentoo) and it does not work. When I launch the app from C::B it does not run and terminates with status -1.

Actually I think it is a helpful feature but I am a little confused by its inconsistent behaviour and I think I would like to have some sort of control on it (enable/disable).

mandrav:

--- Quote from: jeancf on July 06, 2007, 12:39:50 pm ---Thanks for your reply.

I suspected something like that.

I now checked under Linux (gentoo) and it does not work. When I launch the app from C::B it does not run and terminates with status -1.

Actually I think it is a helpful feature but I am a little confused by its inconsistent behaviour and I think I would like to have some sort of control on it (enable/disable).


--- End quote ---

In linux it doesn't work when running through cb_console_runner (e.g. your target is set as "Console application"). I 'm still investigating why that is...

jeancf:

--- Quote ---In linux it doesn't work when running through cb_console_runner (e.g. your target is set as "Console application")
--- End quote ---

My application is a wxWidgets app. In linux the target type for my project is set to GUI Application.

Navigation

[0] Message Index

[#] Next page

Go to full version