How do I create a static library to deploy programs on windows machines?
I am using Qt Creator 3.1.2 (opensource) on a Win7 64 bit machine.
I have created a simple app using C++ with the mingw compiler.
I would like to create a static library in the C:\Qt\SataticApps folder.
I have tried using the following command:
C:\Qt\5.3\mingw482_32>.\configure -static -platform win32-g++ -prefix C:\Qt\StaticApps
which gives the following error:
Error: Could not find licheck.exe
Any ideas out there?
Please see "the deployment guide":http://qt-project.org/doc/qt-5/windows-deployment.html#static-linking.
You need to build Qt libraries statically (download the source code, compile), and then build your application statically, too.
Please be aware that you are (almost) not allowed to do this under LGPL license: you need either GPL or commercial one.
How do I get a GPL?
Is that why I get an error from configure that says it can't find licheck.exe?
No, that error is unrelated.
The source code is the same for LGPL and GPL versions (I think it's also the same for commercial, but am not sure). The choice is that you either publish your application under GPL (in which case you will use Qt under GPL license), or any other license of your choice, in which case you have to obey the rules of LGPL.
I have read the deployment guide. That is where I got the command that I listed in my original post.
I was attempting to configure the build process to create a static version of the libraries as described in the deployment guide.
I'll rephrase my question: why can I not create a static version of Qt as described in the deployment guide? Is the command I issued wrong in some way?
You are most probably trying to configure sources you've acquired through the installer. Those are for debugger introspection, and not for Qt building.
You need to download Qt source code, and compile it. As a reference, you can use "this guide":http://qt-project.org/wiki/Building_Qt_5_from_Git, just skip the git part if you prefer to download Qt source code from the source package ("download link":http://download.qt-project.org/official_releases/qt/5.3/5.3.1/single/qt-everywhere-opensource-src-5.3.1.zip).
By combining those 2 sources you should get a result that works :-)
You got me looking in the right place.
Found I needed to use win32:LIBS "path/to/lib/file.a"
Sorry. That should be win32:LIBS += "c:/path/to/lib/file.a"