10

Did somebody tried to build Qt 4.5 with Visual Studio 2010 (Beta 2)? Any hints on doing that successfuly?

Later edit I tried to run configure from a Visual Studio 2010 console. There is no makespecs support for 2010, so configure fails because of that.

Cătălin Pitiș
  • 13,509
  • 2
  • 37
  • 61

7 Answers7

20

It worked for me to build just as if it was vs2008, but using the vs2010 tools:

  1. Open vs2010 command prompt. cd into the top-level Qt directory.
  2. configure.exe -platform win32-msvc2008 -no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-multimedia -no-qt3support -fast
  3. nmake
Ben
  • 1,268
  • 11
  • 12
  • Yeah, but annoying that you can't build with webkit support. – moswald Apr 29 '10 at 23:15
  • 3
    I've built 4.6.2 with webkit support. You just have to edit a couple files to replace 0 with nullptr. – Ben Apr 29 '10 at 23:20
  • Really? I'll have to check that out. When I saw the (long list of) build errors, I just threw up my hands and gave up. However, I've got a brand-new dev machine here, and no vs2008 installed. I'll try again. – moswald Apr 29 '10 at 23:52
  • Yeah, it's 4 identical changes, each of which triggers ~20 errors during the build. If you can wade through the errors, you'll find a reference to the source file and line that causes the error. – Ben May 03 '10 at 17:12
  • 1
    Looks like the just-released 4.7 beta has added support for VS 2010. – Ben May 06 '10 at 13:19
  • 2
    Can now do --platform win32-msvc2010 to build for VS2010 – Martin Beckett Apr 06 '11 at 02:52
  • @Ben, using your command line (the one marked as solution), do I need DirectX SDK installed to build qt 4.6.4 with vs 2010? – Joel Jun 02 '15 at 16:38
6

For Qt 4.6.2 (or perhaps other 4.6 versions as well)...

To save you some time, here are the errors which need fixing in order to build webkit (this is to expand upon Ben's answer).

The errors appear in the following files (the two files are identical, and the errors need to be fixed in each):

  • %QTDIR%\qt\src\3rdparty\webkit\javascriptcore\runtime\StructureTransitionTable.h
  • %QTDIR%\qt\src\3rdparty\javascriptcore\JavaScriptCore\runtime\StructureTransitionTable.h

Here are the errors and how to fix them:

  1. %QTDIR%\qt\src\3rdparty\webkit\javascriptcore\runtime\StructureTransitionTable.h(146) : table()->add(key, Transition(structure, 0));
    Change it to table()->add(key, Transition(structure, nullptr));
  2. %QTDIR%\qt\src\3rdparty\webkit\javascriptcore\runtime\StructureTransitionTable.h(153) : table()->add(key, Transition(0, structure));
    Change it to table()->add(key, Transition(nullptr, structure));
  3. Make the same two changes for %QTDIR%\qt\src\3rdparty\javascriptcore\JavaScriptCore\runtime\StructureTransitionTable.h (or copy your edited file over this one)
guesser
  • 662
  • 6
  • 11
2

The qt-vs-addin-1.1.6 recognizes VS 2010 now as a suitable platform, but it's not documented yet by qt.

888
  • 2,869
  • 7
  • 35
  • 58
manloeste
  • 21
  • 1
1

Also note that -platform win32-msvc2010 now works as well instead of having to use win32-msvc2008.

Dan
  • 1,800
  • 1
  • 12
  • 18
1

With Qt 4.7 and Visual Studio Add-in 1.1.7, it integrates with VS2010.

See this.

sivabudh
  • 29,317
  • 56
  • 156
  • 219
0

For the moment... I will continue using the builds made with VS 2008 with VS 2010. While I am using it for development purpose only, with no intentions for releasing something (so no manifest nightmare yet), it is acceptable. Hopefully, Qt will soon officially support VS2010.

Cătălin Pitiș
  • 13,509
  • 2
  • 37
  • 61
0

You can find a tutorial how to compile Qt 4.7 Beta 1 using Visual Studio 2010 and Windows 7 here:

TUTORIAL

  • their link changed to http://nanohume.com/underground/2010/06/29/compiling-qt-4-7-beta-1-using-visual-studio-2010-and-windows-7/ instead of the previous link – Dan Oct 06 '10 at 14:22