Static compile in Qt 5.5 (msvc2013)
-
Hi everybody,
I know my question is duplicate but I so confused. I am searching some hours but can not solve my problem. :(I installed Qt 5.5.0 in windows. 32 and 64 bit version of Qt. My compiler is Visual Studio 2013.
I want to compile my projects statically (no need to set dlls, etc beside the exe file) (Only for release output not debug ouptut)Can you guide me step by step?
Thanks a lot. -
@SGaist Hi, Thanks for your reply.
I followed the first link but have a problem. In step 3, when I create a qt5vars.cmd in desktop and run it, I get this error:
C:\Windows\System32>C:\Users\---\Desktop\qt5vars.cmd C:\Windows\System32>REM Set up \Microsoft Visual Studio 2013, where <arch> is \c amd64, \c x86, etc. The syntax of the command is incorrect. C:\Windows\System32>CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC \vcvarsall.bat" <arch> C:\Windows\System32>
Here is the content of qt5vars.cmd:
REM Set up \Microsoft Visual Studio 2013, where <arch> is \c amd64, \c x86, etc. CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" <arch> SET _ROOT=C:\Qt\Qt5.5.0-32bit\5.5\Src SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH% REM Uncomment the below line when using a git checkout of the source repository REM SET PATH=%_ROOT%\qtrepotools\bin;%PATH% SET QMAKESPEC=win32-msvc2013 SET _ROOT=
-
In the first line of the script you can see: "where <arch> is \c amd64, \c x86, etc"
So, <arch> is just a place-holder, you have to replace it with the architecture name, for example x86.
Like this:CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
-
Thanks but another problem:
When I use this command:
configure -static -release -platform win32-msvc2013
After accepting of the terms of licence this error occurs:Creating qmake... execute: File or path is not found (nmake) execute: File or path is not found (nmake) Cleaning qmake failed, return code -1
-
I used
Developer Command Prompt for VS2013
instead ofWindows Command Prompt
and now it is working but now a question:
How can I build my project statically in Qt Creator.
I addedCONFIG += static
but does not work. -
@MohammadReza I never used statically built Qt. What exactly does not work? Any error messages?
-
Did you create a kit that uses your static Qt build ?