How to make the qml executable in windows?
-
-
There is no error, I just run the *.exe file but it shows nothing.
I tried it with Qt4.8 before installing Qt5, and it did open an empty window, but now it shows nothing.
Would you please tell me exactly how to insert the *.qml file in the resources,My be I'm doing something wrong.
-I'm not adding any extra *.qml files I just want to run the ready made hello world, from the exe.
Thanks -
Here is the code
@#include <QtGui/QGuiApplication>
#include "qtquick2applicationviewer.h"int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);QtQuick2ApplicationViewer viewer; viewer.setMainQmlFile(QStringLiteral("qml/asdfasdf/main.qml")); viewer.showExpanded(); return app.exec();
}
@this code is without adding a resource file
-
And here is the main.cpp after adding the resource file
@#include <QtGui/QGuiApplication>
#include "qtquick2applicationviewer.h"int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);QtQuick2ApplicationViewer viewer; viewer.setMainQmlFile(QStringLiteral(":qml/asdfasdf/main.qml")); viewer.showExpanded(); return app.exec();
}
@ -
!http://imageshack.us/photo/my-images/853/49026492.jpg/(photo)!
here is a photo for the resource file, and for the project hierarchic
This is link for the photo if it didn't appear
http://imageshack.us/photo/my-images/853/49026492.jpg/ -
It shows lots of errors
17:11:52: Running steps for project asdfasdf...
17:11:52: Configuration unchanged, skipping qmake step.
17:11:52: Starting: "C:\Qt\Qt5.0.0\Tools\QtCreator\bin\jom.exe"
C:\Qt\Qt5.0.0\Tools\QtCreator\bin\jom.exe -f Makefile.Release
cl -c -nologo -Zm200 -Zc:wchar_t -O2 -MD -GR -W3 -w34100 -w34189 -EHsc -DUNICODE -DWIN32 -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -I"..\asdfasdf\qtquick2applicationviewer" -I"........\Qt\Qt5.0.0\5.0.0\msvc2010\include" -I"........\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtQuick" -I"........\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtQml" -I"........\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtNetwork" -I"........\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtGui" -I"........\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtCore" -I"release" -I"." -I"........\Qt\Qt5.0.0\5.0.0\msvc2010\mkspecs\win32-msvc2010" -Forelease\ @C:\Users\FBM\AppData\Local\Temp\main.obj.2632.16.jom
Copying application data...
1 File(s) copied
main.cpp
Copying application data...
1 File(s) copied
..\asdfasdf\main.cpp(10) : error C2070: ''unknown-type'': illegal sizeof operand
..\asdfasdf\main.cpp(10) : error C3861: 'LQUrl': identifier not found
........\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtCore/qstring.h(193) : warning C4200: nonstandard extension used : zero-sized array in struct/union
Cannot generate copy-ctor or copy-assignment operator when UDT contains a zero-sized array
..\asdfasdf\main.cpp(10) : see reference to class template instantiation 'QStaticStringData<N>' being compiled
with
[
N=-1
]
..\asdfasdf\main.cpp(10) : error C3861: 'LQUrl': identifier not found
..\asdfasdf\main.cpp(10) : error C2070: ''unknown-type'': illegal sizeof operand
..\asdfasdf\main.cpp(10) : error C3861: 'LQUrl': identifier not found
..\asdfasdf\main.cpp(10) : error C3861: 'LQUrl': identifier not found
jom: C:\Users\FBM\Desktop\asdfasdf-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Release\Makefile.Release [release\main.obj] Error 2
jom: C:\Users\FBM\Desktop\asdfasdf-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Release\Makefile [release] Error 2
17:11:53: The process "C:\Qt\Qt5.0.0\Tools\QtCreator\bin\jom.exe" exited with code 2.
Error while building/deploying project asdfasdf (kit: Desktop Qt 5.0.0 MSVC2010 32bit (SDK))
When executing step 'Make' -
I included it and looks like I got the same errors
20:37:14: Running steps for project asdfasdf...
20:37:14: Configuration unchanged, skipping qmake step.
20:37:14: Starting: "C:\Qt\Qt5.0.0\Tools\QtCreator\bin\jom.exe"
C:\Qt\Qt5.0.0\Tools\QtCreator\bin\jom.exe -f Makefile.Release
cl -c -nologo -Zm200 -Zc:wchar_t -O2 -MD -GR -W3 -w34100 -w34189 -EHsc -DUNICODE -DWIN32 -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -I"..\asdfasdf\qtquick2applicationviewer" -I"........\Qt\Qt5.0.0\5.0.0\msvc2010\include" -I"........\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtQuick" -I"........\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtQml" -I"........\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtNetwork" -I"........\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtGui" -I"........\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtCore" -I"release" -I"." -I"........\Qt\Qt5.0.0\5.0.0\msvc2010\mkspecs\win32-msvc2010" -Forelease\ @C:\Users\FBM\AppData\Local\Temp\main.obj.2568.15.jom
main.cpp
Copying application data...
1 File(s) copied
Copying application data...
1 File(s) copied
..\asdfasdf\main.cpp(10) : error C2070: ''unknown-type'': illegal sizeof operand
..\asdfasdf\main.cpp(10) : error C3861: 'LQUrl': identifier not found
........\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtCore/qstring.h(193) : warning C4200: nonstandard extension used : zero-sized array in struct/union
Cannot generate copy-ctor or copy-assignment operator when UDT contains a zero-sized array
..\asdfasdf\main.cpp(10) : see reference to class template instantiation 'QStaticStringData<N>' being compiled
with
[
N=-1
]
..\asdfasdf\main.cpp(10) : error C3861: 'LQUrl': identifier not found
..\asdfasdf\main.cpp(10) : error C2070: ''unknown-type'': illegal sizeof operand
..\asdfasdf\main.cpp(10) : error C3861: 'LQUrl': identifier not found
..\asdfasdf\main.cpp(10) : error C3861: 'LQUrl': identifier not found
jom: C:\Users\FBM\Desktop\asdfasdf-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Release\Makefile.Release [release\main.obj] Error 2
jom: C:\Users\FBM\Desktop\asdfasdf-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Release\Makefile [release] Error 2
20:37:17: The process "C:\Qt\Qt5.0.0\Tools\QtCreator\bin\jom.exe" exited with code 2.
Error while building/deploying project asdfasdf (kit: Desktop Qt 5.0.0 MSVC2010 32bit (SDK))
When executing step 'Make' -
I think that you didn't recompile project or did not add QUrl include because error:
..\asdfasdf\main.cpp(10) : error C2070: ‘‘unknown-type’‘: illegal sizeof operand
..\asdfasdf\main.cpp(10) : error C3861: ‘LQUrl’: identifier not foundIs still the same (the same line). If you added #include <QUrl> then error line would be 11 not 10.
Try to add #include <QUrl> and clean and rebuild projects.
I must say that i didn't use MS compiler for a couple of years and did not remeber complator errors but it's clearly looks like it doesn't have QUrl header.
-
HURRAH, It might be a temporary solution, but I figured it out.
I copied all the *.dll files in the this directory C:\Qt\Qt5.0.1\5.0.1\msvc2010\bin and paste it in the same folder with my *.exe file and it worked.
The next step is to remove one file at a time and run the *.exe after every remove till I figure which files exactly the app needs.@tolszak Thank you very much for your help :)
@qxoz Thank you very much for your help too :)