0

I need to compile Qt4.8.4 with Visual Studio 2012 and use its dlls on windows xp. How can I do that? I made some change in mkspecs\win32-msvc2012 like below, but it didn't work. After I coded an application on Windows 7 with Qt4.8.4, I got an error message: "... is not a valid win32 program." when I executed the application on Windows XP. I have no problem executing the same application on Windows 7.

DEFINES    += UNICODE WIN32 QT_LARGEFILE_SUPPORT  _USING_V110_SDK71_
QMAKE_LFLAGS_CONSOLE    = /SUBSYSTEM:CONSOLE,5.01 

I am missing some point about compiling Qt4.8.4 but I don't know what. If I could compile Qt4.8.4 for targetting WinXP, I would probably solve my problem.

Any help is appreciated.

haitaka
  • 1,832
  • 12
  • 21
  • How does it not work? Some information about the problem might be useful! P. S. Why 4.8.4? The latest is 4.8.5. – Violet Giraffe Sep 21 '13 at 19:46
  • I editted the question to clarify vagueness in my question. Also, I think working with 4.8.5 or 4.8.4 does not matter for my problem. By the way, thanks for your interest. – haitaka Sep 21 '13 at 20:22
  • Try this small turotrial http://stackoverflow.com/questions/14932315/how-to-compile-qt-5-0-1-static-or-dynamic-on-vs2010-or-vs2012-express-under-wind – The Quantum Physicist Sep 21 '13 at 20:24
  • 1
    Thanks for your suggesstion. But, I don't have any problem about compiling Qt on Windows 7. I can compile it successfully and write applications that run on windows 7. But my point is that I cannot run these application on windows xp. I get "... is not a valid win32 application" when I try to execute the application on windows xp. And I think that if I can compile Qt with Visual studio 2012 for targetting WinXP, then I can solve my problem. – haitaka Sep 21 '13 at 20:30
  • So the problem is running on Win XP a program that's compiled on Win 7? Have you installed MSVC2012 runtime libraries on XP? – Violet Giraffe Sep 21 '13 at 20:34
  • Yes, I installed MSVC2012 runtime libraries on Win XP. – haitaka Sep 21 '13 at 20:36
  • I had the same error last week. I ended up recompiling everything using VS2010 however I would certainly be interested in a solution. Even Qt designer built using Visual Studio 2012 in 32 bit mode gave the same error with the vs2012 redistributable installed. – drescherjm Sep 22 '13 at 03:18
  • Perhaps this is the reason: http://blogs.msdn.com/b/vcblog/archive/2012/10/08/10357555.aspx – drescherjm Sep 22 '13 at 03:27
  • From the above link it seams that the problem is using the windows 8 SDK which is default with Visual Studio 2012. The SDK 7.1 is supposed to work and there are build instructions on how to enable that via the command line. – drescherjm Sep 22 '13 at 03:32

0 Answers0