2

I am trying to install Qt4.8.7 for Windows 10 and I am having some issues with installing the corresponding compiler.

I got the Qt4.8.7 installer from this link: https://download.qt.io/archive/qt/4.8/4.8.7/ and I have tried working with the MSVC2010 and the mingw versions. For the MSVC2010 version, I followed this guide https://wiki.qt.io/How_to_setup_MSVC2010 (with a lot of dead links) and installed the compiler alongside the MSVC service pack 1 and Windows SDK 7.1. I have not been able to find an installer for Visual Studio 2010 or the VS service pack 1. Qt studio recognises the version of qt I have installed alongside the corresponding MSVC2010 x86 compiler but when I compile I get this error for a missing header: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\intrin.h:26: error: C1083: Cannot open include file: 'ammintrin.h': No such file or directory".

For the mingw version, I have not been able to find the correct version "mingw482" and other versions I have tried do not seem to be compatible. I have tried mingw installer programs as well as using the QT online installer to try and find the correct version but I haven't had much luck when compiling.

Has anyone got qt4.8.7 running on windows recently? If so, could you please point me in the right direction for installing the correct compiler?

Many thanks.

Ðаn
  • 10,934
  • 11
  • 59
  • 95
Jack
  • 33
  • 3
  • At work I have Qt-4.8.7 building with Visual Studio 2013 for old projects. I build Qt from source code and use CMake to generate my Visual Studio project files for my applications that use Qt – drescherjm Aug 05 '21 at 14:04
  • To build Qt4 from source I believe you need Perl and Python installed. I use ActiveState versions for that. – drescherjm Aug 05 '21 at 14:36
  • Hi, thanks for the reply. I will get a licence for Visual Studio 2013 from work. Do you use CMake from a terminal or are there visual studio tools for that? – Jack Aug 05 '21 at 14:52
  • I run CMake-Gui from a Visual Studio command prompt for the version of msvc I am using. After that I usually use the IDE to build or use `cmake --build` from the command line. – drescherjm Aug 05 '21 at 15:06
  • Thanks so much for the responses. I was able to get a (somewhat) working version with mingw by selecting the correct version using the Qt online installer, I still may need to do this in future as we are considering building from source and so I will refer to this. Thanks again. – Jack Aug 06 '21 at 15:06
  • For the most part building from source is not too bad. I have done this many times on many versions of Qt. However the web components can cause problems if you need them. – drescherjm Aug 06 '21 at 15:14

1 Answers1

1

Here a short description for getting it to work with Visual Studio 2008 and the newest Qt Creator 4.13.

You will need:

  • Visual Studio 2008 Express for the build tools, there are no standalone build tools as far as I'm aware
  • Qt 4.8.7 precompiled for VS2008 from this link to Qt archives at the time of writing this the version you need is called "qt-opensource-windows-x86-vs2008-4.8.7.exe"
  • Any Windows debugger cdb.exe

Steps (all absolute paths are standard installation paths):

  • Install VS2008
  • Install Qt 4.8.7
  • Open your Qt Creator go to Tools->Options...->Kits->Tab Compilers and search for "Microsoft Visual C++ Compiler 9.0", it probably won't be there so you will need to add it by hand by looking for the vcvarsall.bat of this compiler. You will find it in C:/Program Files(x86)/Microsoft Visual Studio 9.0/VC/vcvarsall.bat. Repeat for C, C++, x86 and x64. Press save
  • Open the Qt-Versions tab and look for Qt 4.8.7 Version. It will probably not be there again so add it by hand by selecting the qmake.exe from C:/Qt/4.8.7/bin/qmake.exe. Press save
  • Open the Kits tab and add a new kit. Select your Qt 4.8.7 version and the MS compilers for C and C++, your favorite debugger and input the Qt-makespec win32-msvc2008. Press save again

Now you should be able to compile your project from Qt Creator and Qt-colored-commandline. For integration of MSVC 9.0 into Visual Studio 2015 and newer you will also need to install Visual Studio 2012 Express. In that order:

  1. VS2008
  2. VS2012 (Here MS programmed in some magic so newer VS can see older build tools)
  3. VS201x

It could work in any other order but don't rely on it. Also it could just flat out not work and you will waste a week of your life to fix it; but then it will work.

Haven't tested it but I could imagine the same workflow will work for VS2010.

Baumflaum
  • 749
  • 7
  • 20