PDA

View Full Version : Qt 5.13.0 Basic Shapes C++ example fails with MSVC 2017 (x86)



gib
7th September 2019, 08:28
Having had to replace a failing hard disk, I reinstalled Qt 5.13.0 on Windows 7 (from qt-opensource-windows-x86-5.13.0.exe), and installed VS 2017 Community. I am using a 32-bit kit: compiler MSVC 15.0 (x86), Qt version Qt 5.13.0 MSVC2017 32bit.
The basicshapes-cpp example fails with a great number of errors, starting like this:

QWindowsEGLStaticContext::create: Could not initialize EGL display: error 0x3001
QWindowsEGLStaticContext::create: When using ANGLE, check if d3dcompiler_4x.dll is available
Attempted to use GDI functions with a non-opengl32.dll library
QWindowsGLContext::QWindowsGLContext: Unable find a suitable pixel format.
Qt3D.Renderer.Backend: void __thiscall Qt3DRender::Render::Renderer::initialize(void) OpenGL context creation failed
Attempted to use GDI functions with a non-opengl32.dll library
QWindowsGLContext::QWindowsGLContext: Unable find a suitable pixel format.
Attempted to use GDI functions with a non-opengl32.dll library
QWindowsGLContext::QWindowsGLContext: Unable find a suitable pixel format.
CommandThread: Failed to create local context
Qt3D.Renderer.Backend: bool __thiscall Qt3DRender::Render::GraphicsContext::makeCurrent(c lass QSurface *) makeCurrent failed
Qt3D.Renderer.Backend: bool __thiscall Qt3DRender::Render::GraphicsContext::makeCurrent(c lass QSurface *) makeCurrent failed
Qt3D.Renderer.Backend: bool __thiscall Qt3DRender::Render::GraphicsContext::makeCurrent(c lass QSurface *) makeCurrent failed
...

I'm guessing that the errors are a consequence of the subject of a popup when Qt Creator starts up, with the title "Plugin Loader Messages".
"The following plugins have errors and cannot be loaded:
QmlDesigner
QmlProfiler

Details:
Plugin initialization failed: Cannot create OpenGL context."

This seems to imply that the Qt installation from qt-opensource-windows-x86-5.13.0.exe is faulty. I chose the 32bit version because some other parts of my project are built 32bit, and to get 64bit capability will cost $. Does Qml require the 64bit Qt version? If not, what else could be the cause of this problem?

(I tried to force use of desktop OpenGL with this:
QCoreApplication::setAttribute(Qt::AA_UseDesktopOp enGL);
but that generated a different set of errors.)

gib
8th September 2019, 01:21
I've now confirmed that all three MSVC compiler options available with this installation fail to build a working executable for this example:
MSVC2015 64bit
MSVC2017 32bit
MSVC2017 64bit

This indicates that the problem is not related to the bitness, but rather that the installation provided by
qt-opensource-windows-x86-5.13.0.exe is deficient where qt3d is concerned.

ChrisW67
8th September 2019, 03:39
The basicshapes-cpp example fails with a great number of errors, starting like this:

QWindowsEGLStaticContext::create: Could not initialize EGL display: error 0x3001
QWindowsEGLStaticContext::create: When using ANGLE, check if d3dcompiler_4x.dll is available
Attempted to use GDI functions with a non-opengl32.dll library
QWindowsGLContext::QWindowsGLContext: Unable find a suitable pixel format.
Qt3D.Renderer.Backend: void __thiscall Qt3DRender::Render::Renderer::initialize(void) OpenGL context creation failed
Attempted to use GDI functions with a non-opengl32.dll library

ANGLE provides an OpenGL interface to Qt and uses the DirectX interface on the machine to do the rendering.
What video card is in your machine, what card drivers, and what version of the DirectX libraries have you installed?
Does DxDiag report any issues?
This may be useful: https://support.microsoft.com/en-us/help/179113/how-to-install-the-latest-version-of-directx

Does d3dcompiler_4x.dll exist on the PATH anywhere?

gib
8th September 2019, 05:58
DxDiag finds no problems. DirectX 11. On the Display page the acceleration features are all Not Available.

The video card is an ATI Radeon, but currently the display adapter in use is Standard VGA Graphics Adapter. After reinstalling W7 I suffered many days of BSODs, with much checking of everything and multiple system restores. I finally discovered that some recent update was making the system unstable (the machine would crash at night, presumably when an update was done), so I installed almost all the important updates, none of the optional updates, and turned of automatic updates. It now has survived for 2 days, so I think that was the cause of the BSODs. The problem is I still don't know which update is the culprit, and I haven't run the update for the video card driver in case that's the source of the crashes. I may have to bite the bullet and install the driver from the original CD.

d3dcompiler_47.dll exists in many places, in the install directories of VS2015 and VS2017, and in the various Qt directories. These are not in the PATH I see in a command window, but one is in the augmented path that Qt Creator sets up for a build. I assume that this path is used when I run the example within Qt Creator.

Added after 46 minutes:

I just installed the driver for the Radeon HD 5400, and now the example runs without errors.
Thanks!

gib
9th September 2019, 00:42
Update: Installing the display adapter driver fixed the software problem, but overnight the machine crashed again. I uninstalled the driver (reverting to standard VGA) and this morning the machine is still running (oddly, automatic updates are turned off, so I don't know what event in the night causes the crash.) In any case, it seems that I can have a stable system with basic VGA, without Qt3d capability, or an unstable system with Qt3d capability.

I am going to get install a different video card (just bought a used GeForce GTX 460) to test replacing the Radeon, which might be damaged.