Morix Dev
Morix Dev

Reputation: 2734

Qt 5.2.1 / QtCreator 3.0.x: cannot debug using GDB with custom compilation process

I am using Qt 5.2.1 (from QtCreator 3.0.x) on Ubuntu Linux (12.04 LTS) and I am trying to customize the build process... My aim is to have a build directory different from the source directory (additionally I would like to specify also different directories from temporary files)...

So at the end of the story, I want to have a build directory with the executable and all the shared libraries (so I set the executable rpath to include its own directory) and I want to debug my application from that folder...

Here is my .pro file:

# Configure target directory
DESTDIR = $$PWD/build/bin

# Configure working (obj) directory
OBJECTS_DIR=$$PWD/build/obj

# Configure working (moc) directory
MOC_DIR=$$PWD/build/moc

# Let the linker to search for libraries in build path
# and set the executable search path for including its own folder
DOLLAR = $
QMAKE_LFLAGS += -L $$DESTDIR -Wl,-rpath,$${DOLLAR}$${DOLLAR}ORIGIN

Everything is fine: the compilation is performed exactly as I want... but I've a trouble with QtCreator debugger (GDB) at this stage...

When I try to start the debugging, QtCreator says:

Could not load shared library symbols for libRtCore.so.1. Do you need "set solib-search-path" or "set sysroot"?

(please consider that libRtCore.so.1 is a shared library which my executable relies on and it is available, of course, in the build directory)... How can I setup the debugger for loading symbols also for libRtCore.so.1? Any ideas?

Upvotes: 0

Views: 1222

Answers (1)

Morix Dev
Morix Dev

Reputation: 2734

Ok, found... the problem was that I was running the application using "Run in terminal"... Clearing the corresponding checkbox (as in the screenshot here below) the debugger works like a charm!

RunInTerminal

Upvotes: 0

Related Questions