User forums > General (but related to Code::Blocks)

C::B execution paths

(1/3) > >>

cacb:
I'm on Kubuntu 12.04 running C::B nightly build svn 8248 (from jens Lody repository).

My application uses boost that I have compiled from source and installed in a non-standard location. If I try to run the application from the command line I get the following error message at startup

--- Code: ---error while loading shared libraries: libboost_thread.so.1.51.0: cannot open shared object file: No such file or directory
--- End code ---

This is all quite logical as I am using boost::thread and didn't include the directory where boost is installed in LD_LIBRARY_PATH.

But what is surprising, is that the application starts just fine from within Code::Blocks.
How does C::B find the boost shared object files, when I haven't really told it where to look?

oBFusCATed:
You have by specifying the path for the linker.
C::B uses it to modify the LD_LIBRARY_PATH variable.
C::B makes it work automagically.

cacb:

--- Quote from: oBFusCATed on September 15, 2012, 11:20:58 pm ---You have by specifying the path for the linker.
C::B uses it to modify the LD_LIBRARY_PATH variable.
C::B makes it work automagically.

--- End quote ---

Ok, thanks. Now I understand.

I think that automagic behaviour is often confusing, although quite convenient for those who understand what is happening. Now that default compiler behaviour is to provide a full command line log, perhaps it would be an idea to also display the automagic modifications to LD_LIBRARY_PATH when running a program from within the IDE:

Now it says:
Checking for existence: /path/to/program
Executing: /path/to/program  (in /path/to/project/.)

It could be more explicit:
Checking for existence: /path/to/program
Added to LD_LIBRARY_PATH: /path/to/my/boost/lib
Executing: /path/to/program  (in /path/to/project/.)

Freem:
If you enabled full debug logs, you will have, at least when you debug.

note: A 'recent' (2-3 months ago if I am right) modification made compilation logs full by default, but it have not been made for debug, as far as I know (and if your configuration is older it will not change anyway).
But it is doable: I did when having problems with debugger plug-in and wanted to try with command-line ;)

oBFusCATed:

--- Quote from: Freem on September 20, 2012, 10:43:21 am ---note: A 'recent' (2-3 months ago if I am right) modification made compilation logs full by default, but it have not been made for debug, as far as I know (and if your configuration is older it will not change anyway).

--- End quote ---
Yes, and this won't change in the future, because the log slows down the debugging.

Navigation

[0] Message Index

[#] Next page

Go to full version