0

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.

borune
  • 548
  • 5
  • 21

2 Answers2

1

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:

  1. 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.

  2. 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.

Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313
  • okay, i've build 2 binaries. First with these evironment variables and second without them. There is a FC output: 00000120: 3A F2 00000121: 52 4B 00000158: 06 05 0000015A: 00 01 00000160: 06 05 00000162: 00 01 0003D134: 3A F2 0003D135: 52 4B. So files differs in 8 bytes only. Is it normal? – borune Jun 19 '18 at 20:05
  • Most importantly: what binaries did you build? – Kuba hasn't forgotten Monica Jun 20 '18 at 02:22
  • what do u mean "what binaries"? i am building exe file. – borune Jun 20 '18 at 08:49
  • Compare the dlls of Qt, then. There may be more differences there. – Kuba hasn't forgotten Monica Jun 20 '18 at 10:46
  • i am not compiling qt. The differs between exe for windows XP and newer ones is actually in several bytes – borune Jun 20 '18 at 11:23
  • But I've told you that you need indeed to compile Qt, otherwise the whole exercise is pointless. Yes, the only difference in your executable will be a few bytes. Much more will change in Qt, and the Qt you're using is **not** compiled for XP and thus will cause your application not to work on XP. Targeting XP these days is a costly endeavor if you don't have your build systems set up for CI. – Kuba hasn't forgotten Monica Jun 21 '18 at 17:51
  • Hm..nope. You are wrong. Common QT libraries doesn't depend on OS version u are using. It works everywhere. The problem is only in QWebEngine module. Replacing only the exe file with new one allows me to run my app. Sure web doesn't works as well as ssl. But this is other problem. Qt doesn't require to be recompiled for working in XP. – borune Jun 22 '18 at 06:38
  • They "work" until you hit the point where they won't. The toolset version makes a difference no matter what you are compiling. – Kuba hasn't forgotten Monica Jun 22 '18 at 08:07
0

In VS there is an editbin utility, which could be used as follows

editbin file.exe /SUBSYSTEM:WINDOWS,5.01 /OSVERSION:5.1

borune
  • 548
  • 5
  • 21