OK. I will go through an entire build step by step. I have use the command prompt so I can be precise about what is copied, from where, and it is copy-n-paste ready.
I have the following:
- A fresh Windows 7 machine
- A fresh Windows SDK 7.1 install. This has the same compilers as VS2010, so you will have to substitute 2012 everywhere you see 2010.
- A fresh install of Qt 5.1.1 using the online installer. This is a 32-bit ANGLE build in the default, C:\Qt, folder.
I created a test folder and placed two test files in it.
test.pro:
TEMPLATE = app
TARGET = test
INCLUDEPATH += .
QT += widgets
# Input
SOURCES += main.cpp
TEMPLATE = app
TARGET = test
INCLUDEPATH += .
QT += widgets
# Input
SOURCES += main.cpp
To copy to clipboard, switch view to plain text mode
main.cpp:
#include <QApplication>
#include <QWidget>
int main(int argc, char **argv)
{
w.show();
return app.exec();
}
#include <QApplication>
#include <QWidget>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QWidget w;
w.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
From the Start menu, All Programs, Qt, 5.1.1, "MSVC 2010" launch "Qt 5.1.1 for Desktop (MSVC 2010)"
From the command prompt run:
"C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\SetEnv.cmd" /x86 /release
"C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\SetEnv.cmd" /x86 /release
To copy to clipboard, switch view to plain text mode
(This path may differ depending on how you got your C++ compiler. The batch file may be called vcvarsall and may live under a Visual Studio folder.)
Then build and test the program which should launch a single empty window:
qmake CONFIG+=release
nmake
release\test.exe
qmake CONFIG+=release
nmake
release\test.exe
To copy to clipboard, switch view to plain text mode
Check that the release\test.exe program does not run if double-clicked from Windows Explorer.
Now, back in the command prompt:
mkdir deploy
xcopy release\test.exe deploy
xcopy c:\Qt\5.1.1\msvc2010\bin\Qt5Core.dll deploy
xcopy c:\Qt\5.1.1\msvc2010\bin\Qt5Gui.dll deploy
xcopy c:\Qt\5.1.1\msvc2010\bin\Qt5Widgets.dll deploy
xcopy c:\Qt\5.1.1\msvc2010\bin\libEGL.dll deploy
xcopy c:\Qt\5.1.1\msvc2010\bin\libGLESv2.dll deploy
xcopy c:\Qt\5.1.1\msvc2010\bin\D3DCompiler_43.dll deploy
xcopy c:\Qt\5.1.1\msvc2010\bin\icudt51.dll deploy
xcopy c:\Qt\5.1.1\msvc2010\bin\icuin51.dll deploy
xcopy c:\Qt\5.1.1\msvc2010\bin\icuuc51.dll deploy
mkdir deploy\platforms
xcopy c:\Qt\5.1.1\msvc2010\platforms\qwindows.dll deploy\platforms
mkdir deploy
xcopy release\test.exe deploy
xcopy c:\Qt\5.1.1\msvc2010\bin\Qt5Core.dll deploy
xcopy c:\Qt\5.1.1\msvc2010\bin\Qt5Gui.dll deploy
xcopy c:\Qt\5.1.1\msvc2010\bin\Qt5Widgets.dll deploy
xcopy c:\Qt\5.1.1\msvc2010\bin\libEGL.dll deploy
xcopy c:\Qt\5.1.1\msvc2010\bin\libGLESv2.dll deploy
xcopy c:\Qt\5.1.1\msvc2010\bin\D3DCompiler_43.dll deploy
xcopy c:\Qt\5.1.1\msvc2010\bin\icudt51.dll deploy
xcopy c:\Qt\5.1.1\msvc2010\bin\icuin51.dll deploy
xcopy c:\Qt\5.1.1\msvc2010\bin\icuuc51.dll deploy
mkdir deploy\platforms
xcopy c:\Qt\5.1.1\msvc2010\platforms\qwindows.dll deploy\platforms
To copy to clipboard, switch view to plain text mode
Check that the "deploy\test.exe" program does run if double-clicked from Windows Explorer on the developer machine.
Back in the command prompt:
xcopy c:"\Program Files\Microsoft SDKs\Windows\v7.1\Redist\VC\vcredist_x86.exe" deploy
xcopy c:"\Program Files\Microsoft SDKs\Windows\v7.1\Redist\VC\vcredist_x86.exe" deploy
To copy to clipboard, switch view to plain text mode
This path may be different on your machine: just find the VC redistributable that matches your compiler in the Windows SDK or Visual Studio folders.
Copy the "deploy" folder including subdirectory to another non-dev machine.
Run the "deploy\vcredist_x86.exe" on the target machine to install the VC runtime. (This exe is not required again after this)
Check that the "deploy\test.exe" program does run if double-clicked from Windows Explorer on the non-dev machine.
Bookmarks