Problems with Open-Source Downloads read https://www.qt.io/blog/problem-with-open-source-downloads and https://forum.qt.io/post/638946
Cannot run application written with Qt5.3 and QML in Win7, x86
cristeab last edited by
I have a cross-platform application written with Qt5.3 and QML. I have generated the installer for Windows with NSIS and tested on several platforms (Windows installed in VirtualBox). My application runs on Win 8, both x86 and x64, and Win7 x64. However, on Win 7 x86 I get the following error:
@Failed to create OpenGL context for format QSurfaceFormat(version 2.0 options QFlags(), depthBufferSize -1, greenBufferSize -1, ...)@
All platforms below Win7 have the same error. My application install folder contains also Angle Open GL ES emulation libraries. Is there a work around this issue or is this a limitation of Qt5.3 ?
I am in similar situation with 32-bit Win7 installed in VirtualBox and Qt5.3.1 installed in Win7. Upon launching the QtCreator I get a lengthy message starting like yours:
Failed to create OpenGL context for format QSurfaceFormat( ...
I was wondering if you managed to overcome the problem. Any advice would be greatly appreciated.
EDIT: The problem with the Qt Creator in that setup is completely circumvented by the three steps in the next post.
VirtualBox cannot render Qt's OpenGL-based items, unfortunately. See http://stackoverflow.com/questions/21127335/why-does-qt-creator-3-0-0-welcome-mode-not-work-in-vm
To get rid of the message in Qt Creator, disable the Welcome Screen:
In Qt Creator, go to "Help" -> "About Plugins..."
Uncheck "Qt Creator" -> "Welcome"
Restart Qt Creator
Thanks a lot for pointing out the problem.
Even if I get rid of the message triggered by the Welcome Screen failure, I still will not be able to use the Qt Creator to compile a GUI application (which likely uses OpenGL-based items). It seems that the VirtualBox can not be used to compile or test Qt applications under ANY guest operating system. I personally tried to deploy a Qt-based application in Ubuntu 14.04 installed inside VirtualBox. It failed and reported some OpenGL issues. Same copy later deployed successfully in Ubuntu 14.04 running on a dual-boot machine (which never had Qt installed on it).
You're welcome :)
You can compile after you install the compiler (g++) and Mesa libraries (libgl1-mesa-dev package)
I use virtualbox for all my Qt windows GUI applications. It compiles and runs them just fine.
OpenGL is not used in Qt GUI apps unless you specifically choose to use it.
Edit: have used it with windows xp/7/8/8.1 all in VMs run by virtualbox. My host platform is linux, in case that helps.
JKSH: Just making sure I understood your suggestion correctly: suppose I have
Ubuntu host running VirtualBox with Windows 7 guest.
Then, I am supposed to install the compiler (g++) and Mesa libraries (libgl1-mesa-dev package) on the Ubuntu host, restart VirtualBox with the Windows 7 guest, and try to compile my application with the Qt Creator. Is that the plan?
ambershark: Your post is very encouraging. Maybe I have a separate problem which I incorrectly assumed is related to OpenGL. On
Windows 8 host running VirtualBox with Ubuntu 14.04 guest,
when I deploy my application, I get these two errors:
@libGL error: failed to authenticate magic 3
libGL error: failed to load driver: vboxvideo @
My GUI starts normally but when I try to load an image (I have an image processing application) that image does not show in the image viewer and can not be processed in any way. It seems that the image is never read successfully. The very same binary deploys fine in Ubuntu 14.04 running on a dual-boot machine (which never had Qt installed on it).
Isn't that an OpenGL problem? Or by reading .tif images I implicitly chose to use OpenGL?
Well it could be an opengl problem, but I don't think so. I think you have a plugin issue or didn't build the image plugin into the code properly.
While I've never used the tif format it should be like jpg/png/gif which I have used. Most of those either need a plugin or need to be built with system lib support.
If it's a plugin issue you need to make sure you deploy the plugin with your application. An easy test would be seeing if it worked in your non-deployed package. I.e. you build the application in your development environment and run it, it should have all the plugin stuff it needs to run.
If it works there and not once deployed then you missed the plugin during your deploy phase.
For instance when deploying one of my recent apps for windows my directory would look like this:
So in that above example if I had needed for instance the tiff plugin I would have added:
That plugin comes from <qt root>/plugins/imageformats/.
As for your opengl stuff I would say that you are just having issues with opengl and virtualbox and that it isn't needed for your Qt stuff. You would really need to specifically include opengl for Qt to use it. I don't use opengl much but from Qt4 you had to do QT += opengl in your pro file. Guessing it is the same for Qt5 now-a-days and if you didn't do that or #include any opengl headers chances are your app doesn't use it at all.
[quote author="BorislavK" date="1405559271"]JKSH: Just making sure I understood your suggestion correctly: suppose I have
Ubuntu host running VirtualBox with Windows 7 guest.
Then, I am supposed to install the compiler (g++) and Mesa libraries (libgl1-mesa-dev package) on the Ubuntu host, restart VirtualBox with the Windows 7 guest, and try to compile my application with the Qt Creator. Is that the plan?[/quote]Sorry, I thought you wanted to run Qt Creator in Ubuntu.
If you want to run Qt Creator in Ubuntu, then install g++ and libgl1-mesa-dev. This applies to both "real" machines and virtual machines.
If you want to run Qt Creator in a VM guest, then you don't need to do anything in the VM host.
ambershark: You are absolutely correct. I did have a plugin issue. My approach to plugins was rather naive in assuming that I will be explicitly informed if any is missing as is the case with the Qt libraries. After adding all necessary imageformats plugins to the package it deploys fine in my
Ubuntu 14.04 guest of VirtualBox running on Windows 8 host.
I still get the two libGL error but they do not seem to affect the application. Thanks a lot. You saved me considerable trouble that was certainly coming.
Just confirming that I do not have QT += opengl in my pro file and do not #include any OpenGL header files. And, to add the plugins I had to use the format
JKSH: Thank you for clarifying. I am still to work on the Windows 7 guest to see if Qt can compile any code there once the Welcome screen is disabled.
Great news... Sorry about the bad path for the plugins. I forgot in that project I had setup custom plugin paths for the plugin I had in there.
Anyway, glad it's all figured out.
The opengl thing is nothing to worry about, it's a virtualbox thing that isn't working right now. Has nothing to do with your code at all. :)
And Qt's handling of plugins comes with absolutely no usable error message if it doesn't get included. It bugs me sometimes. The worst is the platform plugins if they are missing can cause crashing rather than an error message. Although those do have messages if things get far enough.
Oh and don't forget to add [SOLVED] to your thread title for future people.
Thanks again. I did add the [SOLVED] tag. Also on the subject, the article at
has a section about deploying plugins which was very useful in my case. It also offers what seems to be a rigorous technique to find out which plugins are needed. It is in the spirit of using Dependency Walker (or ldd on Linux) to find the DLLs your app depends on. (I did not try it but it is there.)
JKSH: After overcoming two other problems, unrelated to VirtualBox, I was able to compile and deploy (on a different copy) of 32-bit Windows 7 running inside VirtualBox. Indeed, the only problem with the Qt Creator in that setup is the Welcome Screen and it is completely circumvented by the three steps in JKSH's post from July 14, 2014.
I am considering the problem solved. Thanks a lot, JKSH. Your answer is right on target.
You're welcome :) Happy coding!