Building a 64-bit application with Qt - qt

I have only been using Qt (version 4.8) for about a week, and it is working like a charm. So far I have only built 32-bit applications with Qt creator, however I would like to build my application as a 64-bit application because it handles large data sets and requires lots of RAM. Can someone please tell me what are the steps involved to build a project from Qt creator as a 64-bit application ? Please note that my OS is Widows 7 Ultimate 64-bit, i also have Visual Studio 2010 Pro on the same machine. Thanks in advance

From the Start Menu (MSVS2010 - VS Tools) start the "Visual Studio x64 Win64 Command Prompt" and then compile from the command line. It worked for me without problems but it takes a long time.

I don't know if Qt supply a 64bit build but it's easy to do your own
Just fire up the visual studio 64bit tools cmd prompt, download the Qt source.
Then type configure -debug-and-release -opensource -platform win32-msvc2010 and nmake

Simply Add Kit for 64 bit target and build for that target.

Related

setting up VS platfrom toolset in QtCreator

I have a project based on Qt which use QWebEngine. For compiling this project i've installed Visual Studio Express 2015 and have configured kits. My project is built, all is fine. But now i need to compile my project for Windows XP platform. I know, that for doing this it is needed to change toolset from v140 to v140_xp.
How can i set the toolset from qtcreator?
I tried to determine the difference in compiler options in both cases. For doing that I've created test project in Visual Studio. There i change the toolset and look at Project Properties -> C/C++ -> Command Line Options. But seems that nothing changes there.
Qt WebEngine module does not support Windows XP targeting, so this won't work anyway. Even if it did, you'd need to build a copy of Qt that targets Windows XP - otherwise your application will target Windows XP, but not the Qt library it uses, and it won't work that way.
For completeness sake, here's how you'd do it assuming that you got Qt built targeting Windows XP:
There only two ways to do it currently without patching Qt Creator itself:
Execute Qt Creator with environment variables already setup up for the XP toolset enabled for command line use. I.e. target XP from command line, and launch Qt Creator from there.
Add relevant environment variable settings to the Build environment of the project in Qt Creator.
The details of environment variables needed to target Windows XP are given e.g. here.
For Windows XP portability, you should be using the semi-maintained for of the qtwebkit module. It builds and works on XP, and works with most recent Qt IIRC.
Note: It's certainly possible to target XP using WebEngine and Angle, but it requires lots of patches to current Qt. It's not an insignificant effort, and you'd definitely want to test it on the graphics cards that you intend to target - the DirectX 9 drivers on some of those machines are buggy, and while the code is correct and compiles and runs, it may not work on some systems. I'd say that it's absolutely not worth the effort.
In VS there is an editbin utility, which could be used as follows
editbin file.exe /SUBSYSTEM:WINDOWS,5.01 /OSVERSION:5.1

Setup qtcreator using Microsoft Enterprise WDK

I'm trying to setup qtcreator using Microsoft Enterprise WDK.
I want to build MSVC and UWP apps, but I do not want to install MS VisualStudio.
Does anyone know howto setup debugger cdb, c and c++ compiler, ... for qtcreator. Since MS EWDK is unzipped in a folder like C:\Dev qtcreator cannot auto-detect it.
I also flipped through the QT documentation, but it is confusing me.
I still have no solution to integrate EWDK into qtcreator.
But there is an alternative to install a "minimum" Microsoft environment for qtcreator:
Install the Visual Studio Build-Tools, which is new as of 2017 and only select the build-tools for C++
Install only the debugger from Windows SDK

Installing Qt and getting it to work - must you install MSVC2012 IDE?

So, like many others I've found on the net, I have installed Qt (Qt 5.2.1 for Windows 64-bit (VS 2012, OpenGL, 553 MB)) and realized that I do not have the MSVC2012 compiler that was used to build this version of Qt.
I come here to ask, is it necessary to literally install the entire MSVC2012 IDE in order to get this version of Qt to work, or can I somehow just install the needed compiler? If so, where might that be available for download? I have done searches and cannot find just the compiler. I have found the compiler bundled with various other software that I do not think I need, but I do not want to go through great effort to find out that I made another mistake.
Alternatively, Qt compiled with minGW is also available, but only for 32 bit. I understand that some 32 bit programs will run on 64 bit machines, but how can you know for sure?
You can install Visual Studio 2012 Express which is free and contains the necessary compiler. After that, you have to also install Windows Kits to get the standalone debugger. Alternatively, you can install Windows 7.1 SDK which does not come with IDE but with compilers and debuggers. Windows 7.1 SDK correspond to Visual Studio 2010. But beware, Windows 7.1 SDK has many bugs, and I would not recommend it unless you are targeting Windows XP.
As for MinGW, yes you can also run 32bit programs on 64 bit, but I personally advise you against MinGW. Its integration with Windows is flaky, and its compile speed is far inferior to MSVC's.

Qt application not a valid 32bit application

I made a simple Qt application. Everything is working well on mt PC. I use Windows 7 SP1 and Qt Creator for building and debugging. When I try to run my program on Win XP I get the error "Not a valid 32 application". I had the same problem when I was making applications with Visual Studio 2012. However I fixed that problem with Visual Studio. In Tools -> Options I made it wo be compiling for Win XP. And everything was working on my PC and on the PC with XP. But I can't find such option in Qt Creator. How can I run my application on Windows XP?
Qt-Creator is only IDE, it uses compiler you tell it to use (I'm assuming it would be VS2012 in your case).
You can check compiler/linker flags in your other VS2012 solution that make a difference (what changes as you set "option compiling for Win XP" when you look to command line input to compiler/linker), and set same flags in your Qt .pro file.
You can see actual input to compiler/linker by going to project properties->C/C++->Command line and Linker->Commnd line respectively in your VS2012 project.
You can set compiler/linker flags in qt using
QMAKE_CXXFLAGS +=
and
QMAKE_LFLAGS +=
in qt .pro file respectively.

Porting QT application from Linux to Windows?

Greetings all,
We are developing a QT application (QT 4.6 LGPL version) in Linux platform.All the libraries we use are cross-platform.
Now we want to port it into Windows and continue develop in Windows.
My questions are:
Which compiler should we use ,Can we use MinGW or Visual C++ compiler?
2.If its Visual C++ compiler, which Visual Studio version should be used ,can we use 'Visual C++ Studio 2010 express' ?
thanks in advance.
The easiest, by far, is to install QtCreator. it includes MinGW and simply opens the same project files as on linux. compile, and go!
A huge advantage of MinGW over VC++ is that it doesn't make you chase circles around getting the right vcredist library for the exact version of the compiler, nor it cares too much about debug/release builds. To deploy, just be sure to copy the same one or two DLLs you have on the development machine. A few more for Qt, but these are well-documented on Qt docs. No hidden surprises.

Resources