PDA

View Full Version : Create Lib using Qt



hao
6th September 2015, 12:20
Hi,

My system is windows 8.1, Visual Studio 2013 with Qt-addin, Qt 5 with commercial licence.

I have to create a library of my code, which use Qt.
But I want Qt inside my lib, in order to deploy it withjout Qt files.

My idea is to compile Qt in static mode, and then create a static lib of my code.
I create in visual a project : Qt library, with static option.
But if I add a Qt classe in my code, I obtain errors, for example :



Erreur 4 error LNK1120: 3 externes non résolus E:\Prog\USE_LIB_STATIC_QTDYN\x64\Debug\USE_LIB_STA TIC_QTDYN.exe USE_LIB_STATIC_QTDYN
Erreur 2 error LNK2019: symbole externe non résolu "public: __cdecl QBuffer::QBuffer(class QObject *)" (??0QBuffer@@QEAA@PEAVQObject@@@Z) référencé dans la fonction "public: __cdecl LIB_STATIC_QTDYN::LIB_STATIC_QTDYN(void)" (??0LIB_STATIC_QTDYN@@QEAA@XZ) E:\Prog\USE_LIB_STATIC_QTDYN\USE_LIB_STATIC_QTDYN\ LIB_STATIC_QTDYN.lib(lib_static_qtdyn.obj) USE_LIB_STATIC_QTDYN


Is it the good approach ?

Thanks