Run QML App outside of Qt Creator
-
Hello
I get an error if I try to run a QML (1 and 2) app outside the Qt Creator.
I create a new QML app with the wizard and make a release build. Then I copy these files from C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin to the build folder:
QML1:
05.02.2013 11:31 18.025.758 icudt49.dll
05.02.2013 11:31 3.090.303 icuin49.dll
05.02.2013 11:31 1.808.899 icuuc49.dll
05.02.2013 11:34 115.200 libgcc_s_sjlj-1.dll
05.02.2013 11:33 968.704 libGLESv2.dll
05.02.2013 11:34 895.488 libstdc++-6.dll
05.02.2013 11:34 68.608 libwinpthread-1.dll
05.02.2013 11:34 4.275.712 Qt5Core.dll
05.02.2013 11:33 2.735.616 Qt5Declarative.dll
05.02.2013 11:33 3.490.816 Qt5Gui.dll
05.02.2013 11:33 1.129.984 Qt5Network.dll
05.02.2013 11:34 1.893.376 Qt5Script.dll
05.02.2013 11:34 218.624 Qt5Sql.dll
05.02.2013 11:34 5.207.040 Qt5Widgets.dll
05.02.2013 11:34 4.425.728 Qt5XmlPatterns.dllQML2:
05.02.2013 11:31 18.025.758 icudt49.dll
05.02.2013 11:31 3.090.303 icuin49.dll
05.02.2013 11:31 1.808.899 icuuc49.dll
05.02.2013 11:34 115.200 libgcc_s_sjlj-1.dll
05.02.2013 11:33 968.704 libGLESv2.dll
05.02.2013 11:34 895.488 libstdc++-6.dll
05.02.2013 11:34 68.608 libwinpthread-1.dll
05.02.2013 11:34 4.275.712 Qt5Core.dll
05.02.2013 11:33 3.490.816 Qt5Gui.dll
05.02.2013 11:33 1.129.984 Qt5Network.dll
05.02.2013 11:33 1.869.312 Qt5Qml.dll
05.02.2013 11:33 2.629.120 Qt5Quick.dll
05.02.2013 11:34 3.204.096 Qt5V8.dllIf I start the app I get this message by both:
@Microsoft Visual C++ Runtime Library
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.OK
@
What is wrong?
-
You missed the platform plugin, but this error is probably something different. Do you have C++ Redist installed? I've seen similar posts to this one recently, try searching the forum.
I don't know the solution myself, I'm using Linux, and in cases where I need Windows, I prefer Qt build with MSVC. The state of MinGW projects is quite appalling.
-
Copying libEGL.dl solved the problem.
This link was also very helpful: http://qt-project.org/doc/qt-5.0/qtdoc/deployment-windows.html
-
Now the app starts without showing an error but if I start the app on an other computer it only shows an tiny window (only the border) without content.
I've copied QML2Anim01-build-Desktop_Qt_5_0_1_MinGW_32bit-Release\qml to QML2Anim01-build-Desktop_Qt_5_0_1_MinGW_32bit-Release\release where the exe file is. But it seems that the app can't find the qml files. But if I start the app on the computer on which the app was compiled it works.
-
Take a look at this thread: http://qt-project.org/forums/viewthread/25714/#119668
Seems to me youre missing the QtQuick.2/ directory at least
And yeah deploying on Windows is a real pain. Wonder how come there isnt an installer for the Qt runtime :o
- Matti
-
libEGL is not a Qt library, you will not find it there.
-
I've made a list of some of the requirements though this largely depends on whether you're using MSVC or MinGW etc. and what your program uses. Still, it might be useful to you so check it out:
Qt/5.1.0/mingw48_32/bin/ :
- icudt51.dll
- icuin51.dll
- icuuc51.dll
- libgcc_s_dw2-1.dll
- libstdc++-6.dll
- libwinpthread-1.dll
- Qt5Core.dll
- Qt5Gui.dll
- Qt5Network.dll
- Qt5Qml.dll
- Qt5Quick.dll
- Qt5Sql.dll
- Qt5V8.dll
- Qt5Xml.dll
- Qt5XmlPatterns.dll
Qt/5.1.0/mingw48_32/plugins/platforms/qwindows.dll (place into <exe_folder>/platforms)
Qt/Tools/QtCreator/bin/ :
- libEGL.dll
- libGLESv2.dll
Qt/5.1.0/mingw48_32/qml/QtQuick.2 (place entire folder into <exe_folder>)
Qt/5.1.0/mingw48_32/qml/QtQuick/XmlListModel (place entire folder into <exe_folder>/QtQuick)
Qt/5.1.0/mingw48_32/plugins/imageformats/qjpeg.dll (place into <exe_folder>/imageformats)The XML stuff you only need if you're using XMLListModel. Same for JPEG I think. You'll have to play around and see what you need.
It's a good idea to build the program with the console window as it will give you hints on what you're missing when you run the program. Also, on Windows the PC must have OpenGL 2.0 or higher for QtQuick 2 to work. It should be enough to update the graphics card drivers, although I have to admit I am not happy about this.