0

I have built a static x86 Qt5.5 library with VS2013 using:

configure -static -prefix D:\Qt\qt-5.5.0-x86-static -opensource -release -static-runtime -nomake examples -no-compile-examples -static-runtime -nomake tools -no-iconv -qt-zlib -skip qtwebkit -confirm-license -qmake -opengl desktop -no-angle -nomake tests -target xp

After that I used this static library build a static-link exe of my Qml App. It can run everywhere in my windows which has been installed Qt5.5.

Then I used VMware Workstation to install a pure Windows XP SP3 only installed VC2008 runtime not VC2013 runtime.

Firstly, I copy the exe into this XP. It can run but had nothing to show. I need kill it in taskmgr.

Second, I copy all folders in D:\Qt\qt-5.5.0-x86-static\qml to the root dir of my exe, it can run. But it shows me only a blank window with correct window title.

I think I have listen all the advise in Deploying Qt 5 App on Windows. But why the qml parts cannot be compiled into static library? How can I let my app not show blank?

P.S. Even if I use windeployqt to deploy share-link library version of app. It also shows me blank window. But it can run on Windows 7.

The output of qtdiag on my virtual XP:

Qt 5.5.0 (i386-little_endian-ilp32 static release build; by MSVC 2013) on "windo ws" OS: Windows XP [winnt version 5.1.2600]

Architecture: i386; features: SSE2 SSE3 SSSE3 SSE4.1 SSE4.2

Library info: PrefixPath: D:\Qt\qt-5.5.0-x86-static
DocumentationPath: D:\Qt\qt-5.5.0-x86-static\doc HeadersPath: D:\Qt\qt-5.5.0-x86-static\include LibrariesPath: D:\Qt\qt-5.5.0-x86-static\lib LibraryExecutablesPath: D:\Qt\qt-5.5.0-x86-static\bin BinariesPath: D:\Qt\qt-5.5.0-x86-static\bin PluginsPath: D:\Qt\qt-5.5.0-x86-static\plugins ImportsPath: D:\Qt\qt-5.5.0-x86-static\imports Qml2ImportsPath: D:\Qt\qt-5.5.0-x86-static\qml ArchDataPath: D:\Qt\qt-5.5.0-x86-static DataPath: D:\Qt\qt-5.5.0-x86-static
TranslationsPath: D:\Qt\qt-5.5.0-x86-static\translations
ExamplesPath: D:\Qt\qt-5.5.0-x86-static\examples TestsPath: D:\Qt\qt-5.5.0-x86-static\tests SettingsPath:

Standard paths [... denote writable entry]: DesktopLocation: "Desktop" *C:\Documents and Settings\Administrator\

The final conclusion: The problem is the graphic driver in my virtual Windows XP. It can run on other real PCs.

But there is a sad problem to static build of QML. I have found this: https://forum.qt.io/topic/22035/qml-apps-not-runnable-using-static-build-up-to-qt-5-0-1-release/24 The reason why I need copy such folders Qt QtQuick.2 QtQuick is that those lib cannot be compile-loaded. Even if I add them into .pro file. From Qt 5.0 to Qt 5.5. The official side seems do not like people use QML by static-link. So, it is waste of time to do static build of QML app.

Community
  • 1
  • 1
zzy
  • 1,771
  • 1
  • 13
  • 48
  • Is there any helpful output on stdout/stderr or the debug channel? – Frank Osterfeld Aug 07 '15 at 08:23
  • @FrankOsterfeld See comments in answer below, that's all output using `2>&1`. – zzy Aug 07 '15 at 08:51
  • @FrankOsterfeld Oh I misunderstand you. I put the exe into pure XP to see where it can run without Qt runtime installed. So I can not debug it. In my development environment , everything works fine. – zzy Aug 07 '15 at 08:57

1 Answers1

2

Qt Quick applications need 3d acceleration in order to work. This is based on either OpenGL, DirectX via Angle or some kind of software renderer that comes with the commercial version of Qt. Since you specifically exclude Angle in your config, you need a proper OpenGL driver. Make sure that OpenGL works on your machine. You'll find tools for that.

I don't think that is has something to do with missing C++ standard libraries (VC2013 runtime), because in this case your application would crash during start and not run. Qt Quick graphic issues however often lead to a running black app that is writing warnings to the console.

Further debugging can be done using the qtdiag.exe command line tool that comes with Qt (It comes with the online installer. I don't know where it is when you build from source). It checks for you which graphic driver is used and often can show error messages.

Simon Warta
  • 10,850
  • 5
  • 40
  • 78
  • I have found the qtdiag.exe , how can I use it to check ? – zzy Aug 07 '15 at 07:18
  • Open a command prompt, cd to the directory, run qtdiag.exe see the output. – Simon Warta Aug 07 '15 at 07:20
  • I run both in real windows 7 and virtual windows XP. The windows 7 has many output but XP just output a little things without anything about graphic driver. I think I need a read windows XP. – zzy Aug 07 '15 at 07:22
  • Please add the output of your XP machine to the question for others to check. – Simon Warta Aug 07 '15 at 07:23
  • The cut in the middle of the "Standard paths" block makes no sense at all. I think it a console issue. Try writing the output to a file please: `qtdiag.exe >> qtdiagoutput.txt 2>&1` – Simon Warta Aug 07 '15 at 07:31
  • It's the same and on windows 7 there is also a "Standard paths" block. – zzy Aug 07 '15 at 07:32
  • I have let other one try the real PC and it can run correctly.Thanks! – zzy Aug 07 '15 at 07:32