[SOLVED] Linker errors at static compiling
-
wrote on 23 Jul 2014, 03:12 last edited by
Hey,
I finally made it to build and install the Qt 5.3.1 static libraries. But when I try to compile, I get some strange linker errors:
@
Qt5Core.lib(Qt5Core.dll):-1: error: LNK2005: "public: __thiscall QString::~QString(void)" (??1QString@@QAE@XZ) allready defined in mainwindow.obj.mainwindow.obj:-1: error: LNK2019: Unresolved extern symbol ""public: static struct QArrayData const * const QArrayData::shared_null" (?shared_null@QArrayData@@2QBU1@B)" in Funktion ""public: __thiscall QString::QString(void)" (??0QString@@QAE@XZ)".
moc_mainwindow.obj:-1: error: LNK2001: Unresolved extern symbol ""public: static struct QMetaObject const QMainWindow::staticMetaObject" (?staticMetaObject@QMainWindow@@2UQMetaObject@@B)".
@Here is my pro-file:
@
QT += core guigreaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = projectname
TEMPLATE = appCONFIG += static
SOURCES += main.cpp
mainwindow.cppHEADERS += mainwindow.h
FORMS += mainwindow.ui
LIBS += -LC:\statics\lib\ -lQt5Core
-LC:\statics\lib\ -lQt5Gui
-LC:\statics\lib\ -lQt5Widgets
-LC:\statics\lib\ -lqtmain
-LC:\statics\lib\ -lQt5PlatformSupport \INCLUDEPATH += C:\statics\include
@I have no idea how to handle these errors. I looked these errors up on this board, but no one of the solutions helps :s
I read something about importing a plugin inside the C++ code, but I can't remember what exactly to do, any ideas?
Thank you,
VVCephei
-
Hi,
Looks like you are trying to use your dynamic Qt and link by hand to your static version.
You should setup your static Qt and Kit using it in Qt Creator
-
wrote on 23 Jul 2014, 17:18 last edited by
Hey SGaist,
thank you, works perfect now :)
Didn't exspect such a simple solution ;D -
You're welcome !
It's not always the hard way ;-)
1/4