I've been coding an application for a couple months on linux, using Qt 4.7.0, and lately i decided to deploy it to windows.
In linux, i have no problem when compiling the whole application (containing a library, a designer plugin, and a executable), but when porting to windows I had some problems with the library (all solved thanks to this forum).
Now that I have both libraries working, the executable project won't compile, prompting a lot of "undefined reference to" errors when linking the libraries.
I have checked that the Qt Creator can compile using the Qt demos, so i guess it's an error in the project files, so i include the configurations i am using:
First library:
TEMPLATE = lib
QT += sql
TARGET = lib1
LIBS += -lstdc++
unix {
UI_DIR = ../.ui
MOC_DIR = ../.moc
OBJECTS_DIR = ../.obj
}
win32 {
UI_DIR = ../ui
MOC_DIR = ../moc
OBJECTS_DIR = ../obj
}
TARGET = $$qtLibraryTarget($$TARGET)
target.path = $$[QT_INSTALL_PLUGINS]/designer
INSTALLS += target
DESTDIR = ../bin
TEMPLATE = lib
QT += sql
TARGET = lib1
LIBS += -lstdc++
unix {
UI_DIR = ../.ui
MOC_DIR = ../.moc
OBJECTS_DIR = ../.obj
}
win32 {
UI_DIR = ../ui
MOC_DIR = ../moc
OBJECTS_DIR = ../obj
}
TARGET = $$qtLibraryTarget($$TARGET)
target.path = $$[QT_INSTALL_PLUGINS]/designer
INSTALLS += target
DESTDIR = ../bin
To copy to clipboard, switch view to plain text mode
The second library (the designer plugin, using the first lib).
TEMPLATE = lib
TARGET = lib2
QT += sql network xml
CONFIG += designer \
plugin
LIBS += -lstdc++ -L../bin -llib1
INCLUDEPATH += . ../model
unix {
UI_DIR = ../.ui
MOC_DIR = ../.moc
OBJECTS_DIR = ../.obj
}
win32 {
UI_DIR = ../ui
MOC_DIR = ../moc
OBJECTS_DIR = ../obj
}
TARGET = $$qtLibraryTarget($$TARGET)
target.path = $$[QT_INSTALL_PLUGINS]/designer
INSTALLS += target
DESTDIR = ../bin
TEMPLATE = lib
TARGET = lib2
QT += sql network xml
CONFIG += designer \
plugin
LIBS += -lstdc++ -L../bin -llib1
INCLUDEPATH += . ../model
unix {
UI_DIR = ../.ui
MOC_DIR = ../.moc
OBJECTS_DIR = ../.obj
}
win32 {
UI_DIR = ../ui
MOC_DIR = ../moc
OBJECTS_DIR = ../obj
}
TARGET = $$qtLibraryTarget($$TARGET)
target.path = $$[QT_INSTALL_PLUGINS]/designer
INSTALLS += target
DESTDIR = ../bin
To copy to clipboard, switch view to plain text mode
And finally, the executable .pro:
TEMPLATE = app
TARGET = Contabilidad
QT += sql network xml
CONFIG += debug \
qt \
thread
INCLUDEPATH += ./ ventanas/
LIBS += -L../bin -L../sqldrivers -lstdc++ -lQtSql -llib1 -llib2
unix{
UI_DIR = ../.ui
MOC_DIR = ../.moc
OBJECTS_DIR = ../.obj
RCC_DIR = ../.rcc
}
win32{
UI_DIR = ../ui
MOC_DIR = ../moc
OBJECTS_DIR = ../obj
RCC_DIR = ../rcc
}
DESTDIR = ../bin
TEMPLATE = app
TARGET = Contabilidad
QT += sql network xml
CONFIG += debug \
qt \
thread
INCLUDEPATH += ./ ventanas/
LIBS += -L../bin -L../sqldrivers -lstdc++ -lQtSql -llib1 -llib2
unix{
UI_DIR = ../.ui
MOC_DIR = ../.moc
OBJECTS_DIR = ../.obj
RCC_DIR = ../.rcc
}
win32{
UI_DIR = ../ui
MOC_DIR = ../moc
OBJECTS_DIR = ../obj
RCC_DIR = ../rcc
}
DESTDIR = ../bin
To copy to clipboard, switch view to plain text mode
Any help would be really appreciated, because i've been trying to deploy to windows for a couple of days and I just can't see the problem (guess its a silly one).
Best Regards
Josep
Bookmarks