4

I have application created with QT5 and Visual Studio 2013. I also use QT WebEngine in my application.

My application works fine in windows 7 (32 bit) . For some reason i need to run it in windows xp sp3 (32 bit).

When i run it, I get the following error:

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

I press OK several time and it goes away and my QMainWindow will pop out, But its totally BLACK and i see the following errors in debugger.

class QWindowsEGLStaticContext *__cdecl QWindowsEGLStaticContext::create(class QFlags<enum QWindowsOpenGLTester::Renderer>): Could not initialize EGL display: error 0x3001
class QWindowsEGLStaticContext *__cdecl QWindowsEGLStaticContext::create(class QFlags<enum QWindowsOpenGLTester::Renderer>): When using ANGLE, check if d3dcompiler_4x.dll is available

The d3dcompiler_47.dll is in application directory too.

Whats wrong here?

UPDATE 1

I placed 3dcompiler_46.dll in executable's directory and this is what happened.

I still get The procedure entry point strnlen could not be located in the dynamic link library msvcrt.dll error but after i press Ok, I get the following error as well.

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

The QMainWindow is still BLACK and the errors about ANGLE is the same.

UPDATE 2

I build QT for Windows XP with following configuration

configure -release -opensource -opengl desktop -target xp -platform win32-msvc2013 -angle -icu -nomake examples -prefix C:\QT-Compile

I replaced QT dependency and ran my application, I got the following errors:

The application has failed to start because icuin56.dll was not found
The application has failed to start because icuuc56.dll was not found

I tried to find them in QT directory (C:\QT-Compile) and i couldn't but i had them on main machine that run in Windows Seven, I placed them next to executable and application run successfully and previous errors are gone, However, The QMainWindow is still BLACK and i have the following errors in my debugger in run time.

QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
bool __thiscall QOpenGLTextureBlitter::create(void) Could not link shader program:

Whats wrong now ?

UPDATE 3

This is how i configured QT.

configure -release -opensource -opengl dynamic -target xp -platform win32-msvc2013 -icu -nomake examples -prefix C:\QT-Compile

I used windeployqt.exe and placed required DLLs and ... next to executable.

Ran application in windows xp and i keep getting following errors then application crash.

Message Box :

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

QT Debugger :

class QWindowsEGLStaticContext *__cdecl QWindowsEGLStaticContext::create(class QFlags<enum QWindowsOpenGLTester::Renderer>): Could not initialize EGL display: error 0x3001

class QWindowsEGLStaticContext *__cdecl QWindowsEGLStaticContext::create(class QFlags<enum QWindowsOpenGLTester::Renderer>): When using ANGLE, check if d3dcompiler_4x.dll is available
Failed to load opengl32sw.dll (The specified module could not be found.)
class QOpenGLStaticContext *__cdecl QOpenGLStaticContext::create(bool): Failed to load and resolve WGL/OpenGL functions
Davis Broda
  • 4,102
  • 5
  • 23
  • 37
M.H.
  • 223
  • 3
  • 10
  • 23

3 Answers3

0

The first error about msvcrt.dll is about not including visual studio runtime dlls with your binary file. It seems that on win XP machine these libs are different then the ones your app is linked against

The next two errors are about failing to start up ANGLE probably due to mismatch of MS VS runtimes that you have encountered previously.

Basically, just put msvcr110.dll and msvcp110.dll in your folder (or provide means to install MS VS Redistributable for 2013 Studio)

Here is detailed deployment doc from digia - http://doc.qt.io/qt-5/windows-deployment.html

Also i would advice you to use qt's tool windeployqt.exe as a part of deploy process. Usage is simple - windeployqt.exe path/to/your/binary/file.exe

It will copy almost everything you app needs to run your app everywhere without bothering you to include some plugins and dlls etc (though it will not copy mentioned above MSVS runtime dlls)

Also if you are interested a post about using different opengl for qt5 built dynamically loading of graphical drivers ( tries to use default opengl -> is fails tries to use ANGLE -> if fails, tries to use opengl software (libmesa) ) - http://doc.qt.io/qt-5/windows-requirements.html#dynamically-loading-graphics-drivers

It's a bit more complicated then in Qt4, but when you finally handle it properly, it will be more fail safe even on machines with no graphical drivers or no direct X support or launched through VPN

UPDATE

It seems that both desktop opengl and ANGLE fails for you (which would mean, that you have OpenGL implementation version less then 3.0 (default on win xp has 2.0) for desktop opengl to fail and you don't have DirectX 11 or DirectX 9 correct drivers installed (for ANGLE to fail).

This would mean that this is either virtual machine or window without any drivers. To fix this issue, please include opengl32sw.dll (libmesa) to you executable file as well. This is another fallback in case both desktop and ANGLE failed.

You can take in from the folder where your QtCreator installed in folder /tools. Or download it here - http://download.qt.io/development_releases/prebuilt/llvmpipe/windows/ depending on your arch.

Also, try to put d3dcompiler_46.dll from your win xp next to your executable. This might fix runtime error and will allow to launch ANGLE - https://bugreports.qt.io/plugins/servlet/mobile#issue/QTBUG-44985

Update 2:

Let's get it line by line. You've got The procedure entry point strnlen could not be located in the dynamic link library msvcrt.dll warning because of either you have win XP with not SP3 but SP2 (microsoft dropped support for win XP SP2 for MSVS 2013) - more details here where there is the same issue. Or there is the same bug here that would basically advice to use opengl software.

Now, the errors you see in log:

  1. class QWindowsEGLStaticContext *__cdecl QWindowsEGLStaticContext::create(class QFlags<enum QWindowsOpenGLTester::Renderer>): Could not initialize EGL display: error 0x3001 - this is failure of OpenGL desktop, since you don't have Open GL 2.0 -> proper graphical driver.

  2. class QWindowsEGLStaticContext *__cdecl QWindowsEGLStaticContext::create(class QFlags<enum QWindowsOpenGLTester::Renderer>): When using ANGLE, check if d3dcompiler_4x.dll is available - ANGLE is failed. Because either - qt uses mvcrt.dll for MSVS 2013 that does not support your Win XP SP2 anymore or you don't have d3dcompiler. Perhaps it will work with Qt 5.4 built with MSVS 2008 or MSVS 2012.

Failed to load opengl32sw.dll (The specified module could not be found.) class QOpenGLStaticContext *__cdecl QOpenGLStaticContext::create(bool): Failed to load and resolve WGL/OpenGL functions - These errors relates to missing opengl32sw.dll file. Which i've already provided link for you to download and put to executable.

And app crashes because Qt was not able to run any of OpenGl modes at all. So basically all you can do is force app to use OpenGL software (i provided link for you how to do this numerous times, please read those guide.) or use qt 5.4 and try to run angle. OpenGL software may not run smoothly and have some problems with complex graphical interfaces but this is basically the only thing that is left.

Shf
  • 3,463
  • 2
  • 26
  • 42
  • I already installed Microsoft Visual C++ 2013 Redistributable Package x86 on win xp machine also copied the DLLs you mentioned in application directory and i still have The procedure entry point strnlen could not be located in the dynamic link library msvcrt.dll error. Also, I have all the DLLs my application need in correct place based on qt windows deployment and i still get Angle error. Thanks for your reply – M.H. Dec 24 '15 at 06:07
  • I also used windeployqt.exe and tested on win xp machine and i have the same errors. – M.H. Dec 24 '15 at 06:34
  • opengl32sw and d3dcompiler_46.dll are in executable's directory and i still have the problem. I am afraid ANGLE is simply not designed to run on XP. – M.H. Dec 24 '15 at 11:20
  • @M.H. do you still have `The procedure entry point strnlen could not be located in the dynamic link library msvcrt.dll` error? Can you update question to display the most recent errors that you see in runtime and errors that are shown in log? And the result you see on the screen (does it render widgets or not). Btw, can you try ro include d3dcompiler_43.dll instead of 47 and 46? – Shf Dec 24 '15 at 11:51
  • And did you try to put there d3dcompiler_43.dll? The link i posted actually said the 43 could fix that error – Shf Dec 24 '15 at 22:26
  • Yes i did . Btw , I use precompiled qt for vs 12. Do you thing maybe this is the problem? Maybe i should build it for Windows xp ... I'm going to try that too – M.H. Dec 25 '15 at 15:14
  • well, basically you see black screen because fallback to opengl software was used, when both desktop and ANGLE failed. Try to install direct X and proper graphic driver on XP machine, should be fine – Shf Dec 26 '15 at 22:38
  • @M.H. did you update driver for graphic card? It seems that this happen when Open GL 2.0 is not supported by graphic card - http://stackoverflow.com/questions/20530157/error-qopenglshader-could-not-create-shader-when-compiling-qtquick-applicati – Shf Dec 29 '15 at 11:45
  • Well, This system is old and it seems it doesn't have any graphic driver and use RDPDD.dll as main driver (directx information). Is there any generic driver that i can use to solve my problem ? – M.H. Dec 29 '15 at 12:13
  • This generic driver is provided by digia in form of opengl32dw.dll . It may not handle very complex Opengl rendering but it will allow system to run on old machines. By the way, you could use angle it does not require modern graphic driver. The only thing it requires is DirextX 9 - 11 support. If it is possible for that system - angle will run. If not - openglsw32.dll is the only way left. – Shf Dec 29 '15 at 12:21
  • The system already have DirectX 9 and also i have openglsw32.dll next to executable . How can i exactly use angle ? – M.H. Dec 29 '15 at 12:24
  • 1
    use this guide - http://doc.qt.io/qt-5/windows-requirements.html#dynamically-loading-graphics-drivers – Shf Dec 29 '15 at 12:26
  • Im gonna build QT again and check the result. Thanks for helping me on this, I really appreciate it. – M.H. Dec 29 '15 at 12:28
  • build qt with `configure -opengl dynamic` (not custom, prebuilt qt should be already built that way) and provide logs. And make sure to put all runtime libs (mvcrt and d3dcompiler). There would be 1 error about opengl is desktop gl fails. One error about angle (glES) if it fails. If app is not crashed - openglsw32 is used. If it is still black screen - this is the most that can be done for that system – Shf Dec 29 '15 at 12:30
  • Im going to use this configuration, configure -release -opensource -opengl dynamic -target xp -platform win32-msvc2013 -angle -icu -nomake examples -prefix C:\QT-Compile . Is it ok ? – M.H. Dec 29 '15 at 12:33
  • remove `-angle` from configure script. `-opengl dynamic` already takes care of graphical settings. – Shf Dec 29 '15 at 12:35
  • @M.H. and do not forget to run `windeployqt.exe` for your exe file. This should fix `not found icu.. dlls errors`. – Shf Dec 29 '15 at 12:38
  • 1
    Re. that infamous error "The procedure entry point strnlen could not be located in the dynamic link library msvcrt.dll": I just tested the Qt 5.6 Beta and i'ts gone :-) – Henry Skoglund Dec 31 '15 at 06:08
  • @Henry Skoglund, I tried with Qt 5.6 but i get "The procedure entry point strnlen could not be located in the dynamic link library msvcrt.dll" error for 6 time then application close automatically. – M.H. Jun 01 '16 at 07:33
  • Try to built it on win XP machine and run `windeployqt.exe` there as well. May fix it – Shf Jun 01 '16 at 10:19
0

We met the same problem in win 7, solved by install the graphics card driver

Jonguo
  • 681
  • 1
  • 10
  • 17
0

I have found another solution as a side option to switch from opengl to software rasterizer and remove these messages:

Could not initialize EGL display: error 0x3001
When using ANGLE, check if d3dcompiler_4x.dll is available

Because in mine case it was the VirtualBox environment which currently having problems with the OpenGL/DirectX (https://forums.virtualbox.org/viewtopic.php?t=82614&start=15#p408392) implementation, then i have tried to search for a solution and somehow workaround the render.

The QT itself have has an option to switch or disable several builtin options w/o need to rebuild anything. Such as is described here: https://doc.qt.io/qt-5/windows-requirements.html#dynamically-loading-graphics-drivers

It is possible to provide a JSON-format configuration file specifying which OpenGL implementation to use depending on the graphics card and driver version. The location is given by the environment variable QT_OPENGL_BUGLIST. Relative paths are resolved using QLibraryInfo::SettingsPath or QStandardPaths::ConfigLocation. The file utilizes the format of the driver bug list used in The Chromium Projects. It consists of a list of entries each of which specifies a set of conditions and a list of feature keywords. Typically, device id and vendor id are used to match a specific graphics card. They can be found in the output of the qtdiag or dxdiag tool.

The qtdiag tool is stored basically near the qmake executable. You can additionally run it to diagnose the end system on other errors.

For the VirtualBox you can try this:

{
  "entries": [
    {
      "id": 1,
      "description": "Software OpenGL rasterizer (opengl32sw.dll)",
      "os": {
        "type": "win"
      },
      "vendor_id": "0x80EE",
      "device_id": ["0xBEEF"],
      "driver_version": {
        "op": "<=",
        "value": "5.1.38.22592"
      },
      "features": [
        "disable_desktopgl", "disable_angle"
      ]
    }
  ]
}

, Where:

disable_desktopgl, disable_angle - When no accelerated path is desired. This ensures that the only option Qt tries is the sofware rasterizer (opengl32sw.dll). Can be useful in virtual machines and applications that are deployed on a wide range of old systems.

  • the 5.1.38.22592 is a version of the VirtualBox.

This is might be not what you search for, but i didn't found it in time for myself.

Andry
  • 2,273
  • 29
  • 28