1

I'd like to build Qt 5.2.1 for Visual Studio on my Windows 7 64Bit machine. I know, there are various similar questions, but none which I have found really give me the feeling that I definately know how to proceed.

First, I tried to follow the instructions in How to build Qt for Visual Studio 2010, but I noticed that things for Qt 5 have changed a bit. E.g., there is no Qt/bin directory that you could add to the path variable, since now there are many different bin directories. I then found http://qt-project.org/doc/qt-5/windows-building.html but here I am not sure if they use Visual Studio 10 and I do not understand the instructions to get the environment variables right. This link http://qt-project.org/wiki/Building-Qt-5-from-Git is also interesting, as it gives various hints, but it uses git and I would like to build from the opensource zip file.

So, what are the steps I need to take precisely? I will write my version here, and you can extend/correct it.

  1. Install Perl and Python and add them to system path
  2. Download http://download.qt-project.org/official_releases/qt/5.2/5.2.1/single/qt-everywhere-opensource-src-5.2.1.zip
  3. Unzip the file from 1. to C:\Qt5.2.1
  4. Install the standalone Windows SDK (http://msdn.microsoft.com/en-US/windows/apps/br229516)
  5. Set up the Qt Environment variables. How?!! Please clarify Step 3 of http://qt-project.org/doc/qt-5/windows-building.html
  6. Open the Visual Studio Command Prompt 2010. Run there

configure -MP -opensource -confirm-license -debug-and-release -no-webkit

  1. Type "nmake" in the Visual Studio Command Prompt 2010.
  2. http://qt-project.org/doc/qt-5/windows-building.html mentions "If an installation prefix was given, type jom install, nmake install or mingw32-make install" - what is an installation prefix??

Then, I believe Qt should be installed in C:\Qt5.2.1; How can I check if the installation was successfull? Is it possible, to have Qt in my list of installed applications using this approach?

I'd be happy if you could correct/comment my approach, since some steps are not entirely clear to me and I have mixed different tutorials.

Thanks!

Community
  • 1
  • 1
user1809923
  • 1,235
  • 3
  • 12
  • 27
  • "it possible, to have Qt in my list of installed applications using this approach?" I do not believe so. Its is not really installed. However you can create shortcuts in your start menu if you want. – drescherjm Apr 08 '14 at 11:59
  • For 5 all I would do is set the following variable in the Visual Studio 2010 command prompt QMAKESPEC=win32-msvc2010 – drescherjm Apr 08 '14 at 12:00
  • Although Step 3 of http://qt-project.org/doc/qt-5/windows-building.html tells you exactly what to do. I mean save that text as a batch file and run it your Visual Studio 2010 command prompt before the configure. – drescherjm Apr 08 '14 at 12:03
  • Step 4 is unnecessary if you have a non free version of Visual Studio. – drescherjm Apr 08 '14 at 12:09
  • Make sure you open the command prompt before step 5. – drescherjm Apr 08 '14 at 12:10
  • hey! ok, for step 3 I will just create a batch file, copy the code into it and run it in the Visual Studio Command Prompt. Step 4 I believe is necessary, or you need to pass "-opengl desktop" to configure. But then you need to make sure that the graphics driver support openGL 2.1 or higher – user1809923 Apr 08 '14 at 12:12
  • For the hundreds of times I have built Qt (yes hundreds of times) for use with 5 or so versions of Visual Studio I have never ever done step 4. Although like you said it may offer updated opengl... – drescherjm Apr 08 '14 at 12:17
  • ok, what about the last step? Do I need to run "nmake install"? – user1809923 Apr 08 '14 at 12:20
  • I run jom. Then nmake after jom finishes. Although nmake install will most likely work. jom is for faster building using multiple cores. – drescherjm Apr 08 '14 at 12:21
  • According to http://qt-project.org/wiki/Building-Qt-5-from-Git the option -MP for configure also speeds up nmake, so maybe jom is not necessary. – user1809923 Apr 08 '14 at 12:25
  • MP does not use as much of the cores as jom. However jom sometimes has problems with parallel generation of moc sources. That is why I run nmake as a final step after jom completes. However either way your build will take an hour or so.. – drescherjm Apr 08 '14 at 12:27

0 Answers0