11

Is there a way to use v110_xp toolset (instead of default "v110") when compiling with "nmake" ?

I'm trying to compile a Qt5 library for VisualStudio2012 and I need it to work on Windows XP machines too. I've managet to compile all Qt5 libraries using VS2012 with nmake, but even simple test applications fails to run on XP machines giving me the "The procedure entry point _except_handler4_common could not be located in the dynamic link library msvcrt.dll". (On Windows 7 machines my test application is working normally)

Gediminas
  • 1,721
  • 2
  • 24
  • 43
  • There's something seriously borked in your makefiles if you end up with a dependency on msvcrt.dll. The last import library that used it disappeared 10 years ago. Very hard to guess how this could happen. – Hans Passant Apr 10 '13 at 15:10
  • Hans Passant thanks for a comment, but (just an example) official Qt's Qt5Core.dll has a dependency for Ole32.dll, and it has a dependency for msvcrt.dll. This can be clearly seen using the "Dependency Walker" software ( http://www.dependencywalker.com/ ) Would really be nice to do some experimenting and to compile Qt using "v110_xp" toolset instead of "v110"... just for now I'm not sure how to do that and if this is possible at all... – Gediminas Apr 10 '13 at 15:36
  • It still doesn't make sense and v110_xp will certainly not make a difference. The only way qt5core.dll could end up with a dependency on msvcrt.dll is when it was built with mingw. – Hans Passant Apr 10 '13 at 16:01
  • Sorry Hans, but I'm not sure I can agree with you regarding the msvcrt.dll. The "procedure entry point.." error was caused by "d3dcompiler_46.dll" (and it's using msvcrt.dll too). This d3d file can't work with XP machines at all (only vista/7/8 platforms) so I ended up using "-opengl desktop" flag when configuring the Qt. This error is now gone, but I still can't run any Qt application on XP machie. Still trying to figure out what's wrong... :/I'm still suspecting the "v110" platform toolset thing.. – Gediminas Apr 11 '13 at 05:04
  • Yes, DLLs provided by Microsoft have a dependency on it. Qt5core is not a Microsoft DLL. And yes, you cannot run programs build with v110 on XP, they require the v110_xp toolset. – Hans Passant Apr 11 '13 at 05:31

4 Answers4

4
  1. Edit Makefile.Debug or Makefile.Release file
  2. Add -D_USING_V110_SDK71_ to DEFINES

Example:

DEFINES = -D_USING_V110_SDK71_ -DUNICODE -DWIN32 -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG

Good luck!

3

Information that I was looking for can be found here: http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx (in "Targeting from the Command Line")

Gediminas
  • 1,721
  • 2
  • 24
  • 43
2

It is easier to edit mkspecs\win32-msvc2012\qmake.conf before you run configure. Edit the DEFINES += line and add the following:

WIN32 _USING_V110_SDK71_

You will have to stash and pop this change whenever you pull.

SteveS
  • 444
  • 3
  • 15
2

nmake /E CC="cl /D_USING_V110_SDK71_ /D_WIN32_WINNT=0x0501" /f Makefile.vc

It is much easier when it is difficult to touch the make file.

zzy
  • 1,636
  • 1
  • 11
  • 40