Assert !isEmpty in file C:\Qt\5.7\msvc2013\include\QtCore\qlist.h when execute *.exe
-
In my QTCreator erverything is working fine. But when I doubleclick my EXE-File I get the error message Debug Error:
Assert !isEmpty in file C:\Qt\5.7\msvc2013\include\QtCore\qlist.h line 341. The error occurs on the following line:_engine->load(QUrl(QStringLiteral("qrc:/main.qml"))); QObject* rootObject = _engine->rootObjects().first();
Like if the main.qml could not be found.
-
_engine->rootObjects() is probably empty.
T &QList::first()
Returns a reference to the first item in the list. The list must not be empty. If the list can be empty, call isEmpty() before calling this function.EDIT: I now realize I misunderstood your problem and my answer above is not very helpful. Sorry!
-
Hi
1: I assume main.qml is in resource and its compiled into the project?2:
Have you tried to make a deployment folder and check it issue persists ?
http://doc.qt.io/qt-5/windows-deployment.htmlPr default, You cannot just click a Qt exe in the build folder.
It needs its support dlls.
However, sometimes it does work as it find the ones from the development folder.But since you need this to have it run on any other computer, why not just the
actual way now? -
I did it like mrjj described. But the error still occures. I figured out that it has something to do that I use QtQuick.Controls 2.0 in my qml files. Without that the program starts. But I Need elements from QtQuick.Controls 2.0. In my *.pro file I use QT += quickcontrols2.
-
Super
if you use QML , you also need the
dependencies of those plugins.Also did you see
http://doc.qt.io/qt-5/qtquick-deployment.html
and
http://stackoverflow.com/questions/25049116/deploy-qt5-qml-applicationSo most likely , its just missing a dll.
There is also
http://www.dependencywalker.com/
You can use this tool to look at what DLLS the .exe wants. and also what dlss the plugins wants.
to spot out if something is missing. -
With CONFIG += console I get the following message in the console:
"QML debugging is enabled. Only use this in a safe environment.
QQmlApplicationEngine failed to load component
qrc:/main.qml:24 Das Plugin des Moduls "QtQuick.Controls" kann nicht geladen wer
den: Die Bibliothek C:\Daten\IPCam\ConfigV2\debug\QtQuick\Controls.2\qtquickcontrols2plugind.dll kann nicht geladen werden: Das angegebene Modul wurde nicht gef
unden.ASSERT: "!isEmpty()" in file C:\Qt\5.7\msvc2013\include\QtCore/qlist.h, line 341"
But the qtquickcontrols2plugind.dll is in the folder C:\Daten\IPCam\ConfigV2\debug\QtQuick\Controls.2.
-
@Locate said in Assert !isEmpty in file C:\Qt\5.7\msvc2013\include\QtCore\qlist.h when execute *.exe:
qtquickcontrols2plugind.dll
That is the debug version. See the small d just before.dll
I assume you trying this with a Debug Build?If you look at qtquickcontrols2plugind.dll with dependencywalker.com can it find all it needs?
I know it says "Das angegebene Modul wurde nicht gefunden." but i had such case with with other DLL and got tired and
copied all dlls to the folder and then it worked. so it seems it was not "found" due to some dlls it wanted was not there.https://forum.qt.io/topic/34210/problem-with-qtquick-controls/15
Best way seems to check if anything missing
-
The dependencywalker doesn't give me any missing file. It is the debug Version of my Project and I already copied the whole qml and plugin folders in the Folder of my exe file. But the problem is the same.
And an other project with QtQuick.Controls 1.4 works fine. -
@Locate said in Assert !isEmpty in file C:\Qt\5.7\msvc2013\include\QtCore\qlist.h when execute *.exe:
And an other project with QtQuick.Controls 1.4 works fine.
Hmm normally dep walker finds it.
You could try with QFile to read the
"qrc:/main.qml"
and see if its truly embedded as it should.Else Im not sure what goes wrong.
You do test the deployment folder on a pc with no Qt installed?
-
@Locate
Good work.
Yes it would be cool if windeployqt took them too.Not sure if a Qt bug or something in this case that made it not
copy it also.If you feel like finding out, you can look in
https://bugreports.qt.io
or even add as a bug or feature request. -
Hi,
You can manually add modules as parameters of
windeployqt
, that might be enough in your case.Hope it helps