2

I have created an application using Qt 4.8.4, and now I have to distribute it on Windows 2000 machines, among the others. I have already tried searching over the Internet for a clear explanation about it, but I can't find a confirmation on what's the older Windows version actually supported by Qt.

The application runs fine on Windows XP (both 32 and 64 bit) and Windows 7 but, when I try to launch it on Windows 2000 I receive the well-known error "[Application name].exe is not a valid win32 application.", and I guess that the error relies on the unsupported Windows version.

The application is a "simple" one, it just need QtCore4.dll and QtGui4.dll as dependencies.

If it can help, I am developing on a Windows 7 64 bit machine, using Qt 4.8.4 and Qt Creator 2.7.1. If I go under Tools->Options->Build&Run->Kits->Manual->Desktop, I have "Microsoft Visual C++ Compiler 10.0 (x86)" as the compiler in use. Do I have to select a different one, maybe?

Thanks for any answer.


EDIT: What I've done after reading @vahancho's answer:

  • "Move" the project from Qt Creator to Visual Studio 2010, using CMake;
  • Install Visual Studio Express 2008 (enabling the V90 Platform Toolset, this way)
  • Open the project from VS2010, and go under Project Properties->Configuration Properties->General and change Platform Toolset to V90;
  • Recompile the project;

Now, I've tried to run the application compiled this way on a virtual machine, mounting Windows 2000, but I get another error, this time: "The procedure entry point DecodePointer could not be located in the dynamic link library KERNEL32.dll".

Andrea
  • 6,032
  • 2
  • 28
  • 55
  • Do you distribute `msvcp100.dll` and `msvcr100.dll` with your application? – vahancho Sep 24 '13 at 07:29
  • @vahancho: Thank you for your reply. And nope, didn't know about them. Can you provide a (really short) explanation about their purpose? Thank you... – Andrea Sep 24 '13 at 07:35
  • @ BiG, you can read http://qt-project.org/doc/qt-4.8/deployment-windows.html#creating-the-application-package instead. I guess you have no VisualStudio 10.0 installed on your target Windows2000 machine, so you probably need to distribute VisualStudio libraries as well. – vahancho Sep 24 '13 at 07:41
  • Thank you so much, @vahancho. I'll try as soon as I reach the customer (I don't have a Win2000 machine, here), and I will let you know. – Andrea Sep 24 '13 at 07:44

2 Answers2

2

Well, after some investigations I found that running MSVC10 applications on Windows 2000 is not possible. You have to build it with at most MSVC9 (Visual Studio 2008), or use the VS2010 Multi Targetting feature to let VC++2010 use the VC++2008 compilers and libraries. Please also refer to this Microsoft Connect discussion.

vahancho
  • 20,808
  • 3
  • 47
  • 55
  • Thank you so much for your time (and for the precious reference too!), but I am still unable to make it work. I listed the operations I've done, as an edit to my question, and the new error I got. Maybe someone can help me further... – Andrea Sep 25 '13 at 13:07
2

OK, some time has passed, but I'd like to give a definitive answer to this question of mine. Unfortunately, what I was asking for it's not possible. @vahancho's answer is right, and the solution he pointed out is correct for the majority of situations. However, DecodePointer is "included" in Windows XP SP 2 kernel, and it's not possible to compile an application using it for an older Microsoft OS, even by choosing the VC++2008 compiler.

An additional reference is given by this post on CodeProject. Fortunately for me, my application was simple enough to let me rewrite it using the good old VB6 :)

Andrea
  • 6,032
  • 2
  • 28
  • 55