spud
23rd February 2010, 15:02
Hi all,
I'm having problems with something that should be very easy.
I have a project which creates a dynamic library and an executable. So far I have only compiled it on Windows and I use the following setup:
#Library pro file
TEMPLATE = lib
DESTDIR = ../lib
DLLDESTDIR = ../bin
DEFINES += CREATE_DLL
CONFIG += debug_and_release
build_pass:CONFIG(debug, debug|release) {
TARGET = $$join(TARGET,,,d)
}
#Application pro file
TEMPLATE = app
DESTDIR = ../bin
LIBS += -L../lib
CONFIG += debug_and_release
CONFIG(release, debug|release){
LIBS += -lMyLib
}
build_pass:CONFIG(debug, debug|release){
TARGET = $$join(TARGET,,,d)
LIBS += -lMyLibd
}
Now I want to debug the application on Linux with Qt Creator. I'm using Ubuntu.
I load the project into Creator and I can compile it just fine in debug or relase mode. The problem arises when I want to launch the application.
Failed to start program. Path or permissions wrong?
I can start the app from a terminal if I call
export LD_LIBRARY_PATH=/path/to/lib
ldconfig
But setting LD_LIBRARY_PATH from within Qt Creator has no effect.
I could of course fix it by setting LD_LIBRARY_PATH globally before I start Qt Creator, but that isn't convinient, since I have a lot of projects with the same setup.
So I was wondering if someone could tell me what the cannonical way is to set up your pro files for a project using dynamic libs(in a portable way). None of the examples or demos from Qt use dynamic libs(not counting plugins, since they're a differnt story alltogether).
I'm greatful for any help and apologize beforehand for my linux noobishness.
I'm having problems with something that should be very easy.
I have a project which creates a dynamic library and an executable. So far I have only compiled it on Windows and I use the following setup:
#Library pro file
TEMPLATE = lib
DESTDIR = ../lib
DLLDESTDIR = ../bin
DEFINES += CREATE_DLL
CONFIG += debug_and_release
build_pass:CONFIG(debug, debug|release) {
TARGET = $$join(TARGET,,,d)
}
#Application pro file
TEMPLATE = app
DESTDIR = ../bin
LIBS += -L../lib
CONFIG += debug_and_release
CONFIG(release, debug|release){
LIBS += -lMyLib
}
build_pass:CONFIG(debug, debug|release){
TARGET = $$join(TARGET,,,d)
LIBS += -lMyLibd
}
Now I want to debug the application on Linux with Qt Creator. I'm using Ubuntu.
I load the project into Creator and I can compile it just fine in debug or relase mode. The problem arises when I want to launch the application.
Failed to start program. Path or permissions wrong?
I can start the app from a terminal if I call
export LD_LIBRARY_PATH=/path/to/lib
ldconfig
But setting LD_LIBRARY_PATH from within Qt Creator has no effect.
I could of course fix it by setting LD_LIBRARY_PATH globally before I start Qt Creator, but that isn't convinient, since I have a lot of projects with the same setup.
So I was wondering if someone could tell me what the cannonical way is to set up your pro files for a project using dynamic libs(in a portable way). None of the examples or demos from Qt use dynamic libs(not counting plugins, since they're a differnt story alltogether).
I'm greatful for any help and apologize beforehand for my linux noobishness.