0
votes

I'm stuck in a deployment issue with my Qt 5.4.0 application. After two days of research, my app really doesn't want to execute on Windows XP !

I have created my deployment folder with windeployqt provided by my Qt installation. When I double-click on *.exe, I have always :

The procedure entry point vsprintf_s could not be located in the dynamic link library msvcrt.dll.

Dependency walker hasn't really helped me and I don't know what I can try now.

Note :

  • SDK : Qt 5.4.0 (MSVC 2010, 32 Bits)
  • IDE : QT Creator 3.3.0
  • Compiler : MinGW 4.9.1 32 Bits
  • Need to run on : Windows XP Pro SP2 32 Bits
  • App works like a charm on Windows 7 with same configuration (IDE, compiler, etc.)
2

2 Answers

2
votes

While Guilhem G. is correct in the broader sense, it doesn't mean you actually called that function yourself (speaking now to a theoretically other person running into this issue like me, heh). I believe it's a bug with MinGW's XP support; I've seen bug reports of similar issues, including nearly the exact same issue in a much earlier version of Qt that was then fixed. I haven't seen this particular incarnation, which I actually ran into myself. I suppose I should probably submit a bug report!

Anyways, I've fixed it without changing any of the code I've written myself. What I had to do to fix it was twofold:

  1. Switch over to using the msvc2010 compiler, since that set of C++ libraries rather unsurprisingly runs fine on Windows XP (AFAIK they still haven't dropped XP support with the latest version).
  2. Switch over to Qt 5.5 (I'll explain why at the end).

For the compiler, you'll need then either Microsoft Visual Studio 2010 (hence the name), or the older Windows SDK that ships with it; the "Microsoft Windows Software Development Kit for Windows Server 2008 and .NET Framework 3.5" release should do the trick for you if you don't have a Visual Studio 2010 license.

Once one of those is installed, I'd encourage you to install Qt 5.5 as compiled by MSVC2010. You can either start a fresh installer or use the Qt Maintenance Tool which should already be installed.

Once that kit is installed, within your project (selecting "Projects" from the left-side menu) you should be able to go "Add Kit" and select Qt 5.5 msvc2010 32-bit, and if you now recompile and redeploy your application, it should run fine on XP.

Now, why did I insist on you upgrading to Qt 5.5? Well, there's some underlying issues with choosing a working OpenGL renderer on each version of Windows, and Qt 5.5 simplifies that a lot by having it fall back on OpenGL or ANGLE depending on what capabilities are actually detected, plus IIRC some other related fixes. So certainly if you're deploying a QML / Qt Quick 2.0 app across multiple Windows versions like I'm doing, it's worth upgrading to Qt 5.5.

0
votes

The error was I called "sprintf_s" somewhere in my code (ok for recent windows on my dev machine but not for XP). If you have the same problem when you search in your code don't use exactly the name of the function in the error message but an expression like *_s. You probably call a secure API function somewhere !