[SOLVED] Can't link static library to executable - missing declarations?
-
wrote on 14 Nov 2011, 10:37 last edited by
Here I am, again. This is output from Output panel (Compiling EXE with Project.Global.lib (static library)).
@
Project.Global.lib(SingleCoreApplication.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall QLocalServer::listen(class QString const &)" (_imp?listen@QLocalServer@@QAE_NABVQString@@@Z) referenced in function "protected: void __thiscall Project::Global::SingleCoreApplication::init(void)" (?init@SingleCoreApplication@Global@Project@@IAEXXZ)
@Something is missing...it's not available to linker, but what? I think it's missing Qt Classes, but I am not sure...
-
wrote on 14 Nov 2011, 10:49 last edited by
Do you want to link statically against the Qt library? Did you build a static version of the Qt library? Do you actually use the static build (you linker is obviously looking for an imported symbol from a shared library)?
-
wrote on 14 Nov 2011, 10:54 last edited by
No. I am building application, which takes global static library Project.Global.lib, which includes classes SingleCoreApplication (SingleApplication). No, I didn't build static Qt libraries (Do I need it build?)
-
wrote on 14 Nov 2011, 11:06 last edited by
No you don't. Did you build the static lib against the same version of Qt?
-
wrote on 14 Nov 2011, 11:07 last edited by
Yes, I do it on one place.
-
wrote on 14 Nov 2011, 11:13 last edited by
Just to be sure: have you added the network module to your .pro file?
-
wrote on 14 Nov 2011, 11:20 last edited by
To Library or Application? To library yes, to application not.
DONE. It works, but. It don't show any console window (application is running)...
-
wrote on 14 Nov 2011, 12:39 last edited by
Check if you are missing a CONFIG += console in your .pro and if the subsystem type is Console (/SUBSYSTEM:CONSOLE) if you are using MSVS.
1/8