PDA

View Full Version : How to build a standalone project with Qt 5.4 and msvc2013



Rabbitl96l
15th April 2015, 18:14
I have written a small application and I have to handle it to my teacher. However, there is a case that his computer has not installed Qt Creator. Please help me to build a stand-alone executable file (I think it is static linking or something). Thanks in advance.

Added after 58 minutes:

I have tried to use "configure" command on the qt command prompt, but it keeps saying that "configure" is not recognized as.......

Lykurg
15th April 2015, 21:04
Hi, have you seen http://doc.qt.io/qt-5/windows-deployment.html?

Rabbitl96l
16th April 2015, 01:49
In the Qt command promt, when I type:
cd D:\Qt\Qt\5.4\Src\qtbase
configure -platform win32-msvc2013 -static -release -no-opengl

It pops out like:
NMAKE: fatal error U1077: ' "D:\Visual Studio 2013\VS 2013\VS\bin\cl.EXE" ': return code '0x2'
Stop.
Could not find output file 'arch.exe' or arch in D:/Qt/Qt/5.4/Src/qtbase/config.tests/arch: No such file or directory

Please help me.

Rabbitl96l
16th April 2015, 05:56
First, I open D:\Qt\Qt\5.4\msvc2013_64\mkspecs\win32-msvc2013\qmake.conf and D:\Qt\Qt\5.4\Src\qtbase\mkspecs\win32-msvc2013\qmake.conf to modify its CONFIG to "CONFIG += incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target" and "QMAKE_CFLAGS_RELEASE = -O2 -MT -Zc:strictStrings".

Then, I use Developer Command Prompt for VS2013 to type these commands:
cd D:\Qt\Qt\5.4\Src\qtbase\
configure -static -release
nmake sub-src

I wait for the computer to finish its process. After that, I open the project, modify its .pro and try to release the project. However, it shows those errors.

1109611096

Please help me.

Lykurg
16th April 2015, 18:22
I haven't build static app on windows lately, so I am not a good help here. Why, however, do you want to build it statically? Just bundle the needed dlls along with your app and you are clear to go.