User forums > Using Code::Blocks

Tools menu and Linux environment

(1/2) > >>

cacb:
Inspired by the discussion in the thread Export to CMake I downloaded and built the gede debugger (and kdbg as well). This is under Kubuntu 20.04.  I was able to start these debuggers from a simple user defined tool entry in the Code::Blocks Tools menu. Debugging worked for simple programs with no external *.so files so that was kind of promising.

Then I tried slightly larger GUI programs depending on *.so files and both debuggers (gede and kdbg) refused to launch these because the *.so files could not be found. Then I tried launching the the exact same commands from a terminal window (konsole) and then debugging worked fine, *.so fiiles were found.

The difference is that my user's LD_LIBRARY_PATH (defined in ~/.bashrc ) is cleared when launching Tools menu items. This is unexpected (and different from similar features in Windows). When you launch the built-in debugger in C::B I can see LD_LIBRARY_PATH is explicitly set, but it doesn't seem logical that the Tools menu would interfere with it?

Any comments?
 

BlueHazzard:
Tools or Tools+ plugin?

cacb:
Tools menu,  I have disabled Tools+ long ago and I do not use it

cacb:
I solved the problem with loading *.so files.

Using ~/.bashrc to define LD_LIBRARY_PATH only works in a bash shell, so it is not the proper way to do it for all uses.

Instead, I made a file  /etc/ld.so.conf.d/myconfig.conf
and put a line in there defining the directory of my *.so files.

Then I did a

--- Code: ---sudo ldconfig
--- End code ---

Now things worked as intended, the debuggers could find my *.so files

BlueHazzard:
So the big question is, is this expected behaviour from codeblocks or not? I mean, isn't codeblocks adding its own paths to LD_LIBRARY_PATH, and when we use them in the Tools menu start, could this interfere?

Navigation

[0] Message Index

[#] Next page

Go to full version