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.
Related
I'm using QT for the first time to build a GUI. I'm following this Tutorial.
I followed the steps one by one as shown in the screenshot below.
Select the project
I selected Other project>>Empty qmake Project. Next I'm prompted to add the Kits.
Add Kits
I add the Kits, but in the next Tab "Qt Versions", there are no QT versions.
No QT Version
I figured i didn't install any QT Versions during the installation process. so I opened up the "Add or remove programs" and found that these are the components I have installed.
Installed components
Will these suffice to build a Desktop GUI using QT creator or are there any other components I have to install as well?
So, for a first try, I suggest using the MinGW compiler, since it is installed by Qt Maintenance Tool.
If you need to use the MSVC compiled Qt like the one selected in your pick, but you need also to install Visual Studio since you need the MSVC Compiler. If you also need to debug an MSVC Qt Application via QtCreator you need to manually configure the CDB, since the one installed with Visual Studio is not detected by Qt Creator.
Those pieces of information are related to MSVC2017 and Visual Studio 2017. If you intend to use MSVC2019 I don't know how QtCreator manages that.
About your situation is strange, you installed the MSVC Qt so they should be detected in QtCreator (tools -> options -> kits -> Qt Versions). I suggest to completely uninstall Qt and restart the process selecting just the MinGW 64-bit, QtCreator and MinGW Compiler 7.
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
I am having trouble deploying an application on machines other than my development machine.
I have a Print button on several menus which works well on the development machine, when running in a Release build in QT Creator. However when I build the project into a .msi file using WiX and distributing it to other computers the Print dialog will not appear. Is this most likely a problem with my WiX file? The version of the .dll file I am using? The .pro file (which includes printersupport in it)? How is it that QT Creator can find and run the code needed for the dialog but other systems cannot?
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.
I want to use QtCreator and MSVC as a compiler instead of MinGW. I successfully compiled Qt source code with MSVC 2010. As you would have guessed, I have MSVC 2010 installed on my machine. I also registered MSVC version of Qt in QtCreator, but now the problem is that I can’t select MSVC toolchain in qtcreator.
So far, I found out that QT_INSTALL_LIBS and QT_INSTALL_BINS are not correctly configured for MSVC version of qt binaries. I guess this could be the problem, but I don’t know how I should configure that variables.
Here's the screenshot
Check if you have define the environment variable QTDIR (this can be done in command line, using set command). This allows Qt Creator to auto-detect the value.
Also, could you try to rename the folder not using 'c++', instead use e.g. 'cplusplus', and see if this could also resolve the problem.
You need to set your QMAKESPEC environment variable to "win32-msvc2010" (or create the variable if you don't have it), then restart QtCreator. This tells Qt and QtCreator that you are using the msvc compiler of Visual Studio 2010 for 32bit windows applications.
That should do the trick.
PS: If you have any Windows Explorer windows open you need to close these too after setting the environment variable.
PPS: Press [windows-key][Pause] to quickly access the system properties dialog