QtCreator: static library but still asking for DLL
I'm using QtCreator and I got two projects, each with an own PRO file.
The Viewer is a normal Qt app. The other one, let's call it Utilities, is supposed to be a static lib开发者_JAVA技巧rary which is used in the Viewer.However when I compile and run the Viewer (everything compiles fine), I get an error message telling me Utilities.dll was not found.
This is the first part of the PRO-file for Utilities:
QT -= core gui TARGET = Utilities TEMPLATE = lib CONFIG += staticlib warn_on $$(QMAKESPEC)
Shouldn't it work that way?
Why is it compiling the Utilities.a file fine but asking me for the DLL at runtime? It's supposed to be a static library :( Since I did not specify some needed libraries in Utilities.pro, it apparently did not link as you'd expect for a static library.My platform is W7-x64, latest Qt SDK and MingW 4.4 bundled with it. Hope anyone can help :/
Thanks!
The CONFIG += staticlib
request your target library to be a static lib not the entire dependency chain ... I am pretty sure your .a
lib will require mingw
dlls to run ...
If you want to reduce dependencies try the MSVC
tool chain (Qt provide pre-compiled package for that) you will end with one or two mandatory dll dependencies. Or you can link again static mingw
SDK (you will probably have to build it your-self ...).
精彩评论