How to activate run and debug in codeblocks

In the settings menu, go to environment > environment variables.

There add a new variable with:

VALUE = ./libs

With that run and debug will work without the need to activate the runOnBuild variable.

Also for non-english linux installs, you can add another variable to avoid the problem with warnings being recognized as errors:


Be sure that this variables are activated by checking the checkboxes.

I’m going to modify the install_codeblocks script to add this variables to the install but by now this should do.

Just realized that has nothing to do with the environment variables but with some update in codeblocks, so it just should work without doing anything for the core examples.

For the addons examples, you should edit the cbp project file and add the following line at the end of the linker section:

<Add directory="../../../export/libs" />  

De lujo! :smiley:
Proper debugging at last!

I got run and debugging working just now through a slightly different technique.

If you open the following dialogue box:

** Project->Build Options->Search directories->Linker**

and add the following:


so that it looks something like this:


Then codeblocks will automatically add this to its local LD_LIBRARY_PATH when it executes the application.
And Run and Debug will also work!

Yes, it’s just the same, the last versions, use the linker path settings also to set the LD_LIBRARY_PATH when it executes or debugs the application…

I’ve just upgraded to Ubuntu 8.10 and I’m using Codeblocks 8.02 straight from the repos and it seems that running apps from within Codeblocks is broken for me at the moment. I’ve tried all of the above tricks and nothing seems to work…LD_LIBRARY_PATH is simply not being set with I run the app internally.

Anyone else have this problem? Do I need to get a version from svn?

I think this only works for the last versions in the svn, it began working some months ago with an update from the svn repositories. You can use the install_codeblocks script in the scripts folder to install the last svn version.

hey very nice post, it worked for me as well. with the actual version of codeblocks (8.02-) ( + of (0.061 – a )

i don’t know much about it. i would like to ask a question:

  1. When i choose “valgrind:memcheck” than a new file is generated valgrindOut.xml

But how is this test done? My programm is searching websites, but to be able to search websites, i have to put an url in the commandline. thanks.

i am happy about every information.

valgrind is a memory check program it tells you if your application has any memory leaks and where, the xml should be shown in a panel inside codeblocks. showing the lines and the kind of errors your app has