March 8, 2012

DouDou DouDou
Lab Rat
10 posts

[Solved]How to build 64-bit application

 

How can we build a 64-bit application with Qt for Windows?

6 replies

March 8, 2012

koahnig koahnig
Gene Splicer
2905 posts

That is dependent on the environment you like to use. For instance you may use the 64 bit version of mingw . [qt-project.org]
In addition you can use the various versions of visual studio for 64 bit compilations.

March 8, 2012

DouDou DouDou
Lab Rat
10 posts
koahnig wrote:
That is dependent on the environment you like to use. For instance you may use the 64 bit version of mingw . [qt-project.org] In addition you can use the various versions of visual studio for 64 bit compilations.

Thanks for the reply. My question is on how to access it from Qt creator like in Visual Studio you can change the target machine with configuration manager from Win32 to x64. I cant find a similar option in Qt creator, the only thing I was able to find under ‘options > build & run > tool chains’ was the ‘Microsoft Visual C++ Compiler 10.0 (x64)’ under ‘Auto-Detected’, however selecting that and clicking ‘apply’ didnt have any effect on the project, because when i try to build it, it is still coming out as a 32-bit application.

March 8, 2012

Tobias Hunger Tobias Hunger
Robot Herder
3387 posts

DouDou: Tools>Options>Build & Run>Tool chains lists all tool chains creator was able to detect. Which one gets used depends on your project: Check Project>Build Settings, that should have a drop down box with all the tool chains that can produce code for the Qt version you have selected.

So to do 64bit Qt apps for windows in Qt Creator you need a 64bit Qt first. If you remove Qt from your qmake project, then creator offers to use any of the available tool chains for building.

Note that we do “best effort” when it comes to picking a mkspec to build, please check the -spec argument of the qmake step and make sure it is sensible:)

March 8, 2012

DouDou DouDou
Lab Rat
10 posts

Tobias Hunger wrote:
DouDou: Tools>Options>Build & Run>Tool chains lists all tool chains creator was able to detect. Which one gets used depends on your project: Check Project>Build Settings, that should have a drop down box with all the tool chains that can produce code for the Qt version you have selected.

So to do 64bit Qt apps for windows in Qt Creator you need a 64bit Qt first. If you remove Qt from your qmake project, then creator offers to use any of the available tool chains for building.

Note that we do “best effort” when it comes to picking a mkspec to build, please check the -spec argument of the qmake step and make sure it is sensible:)

Thanks, two questions:

a) where can I download Qt-64bit for Windows
b) How do i remove Qt from the qmake project?

Sorry for the very studpid questions, have been using Qt for 3 days only

March 9, 2012

DouDou DouDou
Lab Rat
10 posts

Okay, i figured it out. Currently Qt does not have official 64-bit binaries, so you will have to build those yourself, which is very easy if you have Visual Studio 2010. Download the Qt source and then go to Visual Studio x64 command prompt and build Qt from there.

March 9, 2012

Tobias Hunger Tobias Hunger
Robot Herder
3387 posts

To disable Qt in a qmake project you can do this:

  1. CONFIG -= qt
  2. QT -= core gui

The first one will suffice with with qmake and a recent Qt Creator (> 2.4.x). Earlier creators need the second line to detect that you do not want Qt.

 
  ‹‹ how to make QQuickView TranslucentBackground      Problem about creating DLL in QtCreator ››

You must log in to post a reply. Not a member yet? Register here!