I needn't use the QT's dlls and I want to use libs, when I run exe.How can I do this?
I needn't use the QT's dlls and开发者_运维百科 I want to use libs, when I run exe.How can I do this?
Just as Vincenz said: you need to statically link.
BUT: if you are using the GPL-version of Qt, you should give your customers the possibility to relink with Qt if they want, which in practice means that you have to distribute your own application in source code or object code form as well.
An alternative is to obtain a commercial (paid) Qt license. This allows you to statically link Qt code in your application without the need to distribute your own sources or object files.
Well you need to statically link the library. See here: http://doc.qt.io/qt-5/windows-deployment.html#static-linking
You must link statically with the libraries (.dlls like QtCore4.dll, QtGui4.dll, etc...). You can find these libraries in the "bin" folder or the Qt directory.
As said by Patrick, be sure to know what are the rights you have with the license you are using.
Also, you should compile in "Release" mode to be able to use the regular .dlls instead of the debug ones. The debug ones take a lot more space than the release ones, so it is pretty important.
Hope that helps.
精彩评论