Cannot link statically with MSVC2008.
-
Did you compile Qt for static libs?
If you have downloaded some binaries you have only a dll-compiled version. For static libraries you need to compile the whole source yourself.
For windows you have to download "this zipped version":http://download.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.zip
Under step 4 in "this":http://developer.qt.nokia.com/doc/qt-4.7/install-win.html you find some hint for compilation under windows. -
Hmm, OK. But there are alot of .LIB files as well in the SDK I've installed. Why can't I use them?
I even tried to remove the DLLs, hoping the linker should take the LIBs instead. But no...(BTW, I'm currently building Qt static as koahnig suggested, it has already taken 5-6 hours in my Virtual VMWare Windows 7 and is not ready yet...)
-
Oh, and be aware of license implications when using static libs!
If you use the (L)GPL version of Qt, it's most likely that you need to release the source code of your application under GPL too (I'm not a lawyer, so do your own research beforehand!). If you do not want to release your source code, you will be in need of a commercial license.
-
The SDK consists of the Qt libs itself ("Qt") and additional tools, like Qt Creator, a free toolchain (MinGW) - if you choose that.
So, basically no, you do not necessarily need the SDK. Qt Designer, Assistant, Linguist, etc. are part of the libs. Qt Creator can be downloaded separately.
-
I've built Qt (lib), installed Qt Creator, and when I try to build my application it cannot find the Windows SDK LIB-files. I can see them in the file system (But Qt cannot). What is the best way to add LIB path? In my .pro-file, in the mkspec-file or declare an environment variable?
Or should I try to make Qt Creator run the MSVC2008 vcvarsall.bat setup file?
-
My mistake! I had the MinGW tool chain specified, should be MSVC2008...
Now my exe file is 13 MB instead of the 35 kB it was when I linked it dynamically. 13 MB sure sounds as if I have built-in the static libs which was my goal!
But when I try to run it on a machine where Qt is not installed, I get "The application has failed to start because its side-by-side configuration is incorrect..."
Maybe my build was unsuccessful after all? -
But it does seem to have something to do with the redist. The Event Log says (dummyTest.exe is my program...)
Activation context generation failed for "D:\tools\qttests\test1\dummyTest.exe". Dependent Assembly Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8" could not be found. Please use sxstrace.exe for detailed diagnosisSo I unistalled the VC redist, rebooted, and installed the VC redist again. Same fault. And the version 9.0.21022.8 from the log post matches exactly the redist version. What else is there to do?
-
[quote author="Gerolf" date="1320747501"]which version of redist?
debug redist are never installed!
use the release build on that machine and it should work.
Debug versions are never meant for distribution...[/quote]Not only that they are not meant for distribution, but Microsoft does not allow you to do so!