X64 makepec for x64 solution for Visual Studio?

We are currently using qmake and .pro files to create projects for Visual Studio 2008, but the default solution platform is Win32. Every time projects are rebuilt, I have to manually change the platform to x64 by going to the configuration manager and copying the settings from the Win32 solution.

I was not able to find online / QT forums to automatically create a VS2008 solution configured for x64 build. Do I need to create my own makepec for QT? Do I need to specify x64-specific VS flags? Does anyone have an example that they can post that they have successfully used to create x64-spec projects?

+4
source share
3 answers

Thanks to the_mandrill this solution:

First you need to download patch 3891 . Then you need to apply the patch - you can find the patch utility for windows, but I just edited the files broken out in the patch manually; files are located in \ qmake \ generators \ win32

Then you need to create QT from scratch, which can be done by navigating the command line (make sure that this is the Visual Studio 2008 x64 command line from the Visual Studio directory) to the directory in which you installed QT, presumably C: /QT/4.7. 0 and enter configure , then nmake .

Building a QT will take a lot of time. In the meantime, adding them to your qmake files will automatically determine your host OS. Keep in mind that this solution does NOT configure win32 and x64 on x64 - only x64 configuration.

contains(QMAKE_HOST.arch, x86):{ QMAKE_LFLAGS *= /MACHINE:X86 } contains(QMAKE_HOST.arch, x86_64):{ QMAKE_LFLAGS *= /MACHINE:X64 } 

This creates a working x64 Visual Studio solution that compiles and links without errors.

+2
source

This is a known issue. There are a couple of related errors in Qt bugtracker: QTBUG-6910 and QTBUG-4046 . This second entry also has a link to the patch, which you can use if you yourself create Qt. Vote for bug fixes to increase the visibility of this issue.

+4
source

This was fixed at 4.8.

You need to run qmake from the VS x64 command line so that it can detect the amd64 compiler in the PATH variable.

+1
source

All Articles