I have a shared library (with no QT dependency) [library B] that links to another shared library (with no QT dependence as well) [library A].
I am using Qmake and QT Creator 1.3. The problem is that when I build library B and run ldd on the executable, it is being linked to QtCore and QtGui, both of which are pulling in lots of unrequired files, resulting in an executable that is taking long to load, and has unwanted dependencies.
I have tried just about everything to stop qmake from linking these libraries to library B.
A snippet of my project file for library B is shown below:
TEMPLATE = lib
LIBS += -L../datelib/bin -ldatelib_release
QT -= gui core
LIBS -= -lQtGui -lQtCore
CONFIG += dll
CONFIG += debug_and_release
CONFIG(debug, debug|release) {
TARGET =targetnameD
}else {
TARGET = targetname
}
I am using QtCreator 3 on Ubuntu 9.10
QT is version 4.5.2
The purpose of a . pro file is to list the source files that are involved in a project. Since qmake is used for building Qt and its associated tools, it knows Qt very well and can generate rules for invoking moc, uic, and rcc. As a result, the syntax is very concise and easy to learn.
The behavior of qmake can be customized when it is run by specifying various options on the command line. These allow the build process to be fine-tuned, provide useful diagnostic information, and can be used to specify the target platform for your project.
qmake.exe is in bin directory of your Qt installation folder (along with all the Qt dlls for deployment). Your compiler should be detected automatically (check the Tools > Options > Build & Run > Compilers tab).
Put CONFIG -= qt
in your .pro file.
You can try with
CONFIG += dll
QT -= gui core
LIBS -= -lQtGui -lQtCore
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With