Run qt qml app on another pc - qt

I wrote some app in Qt 5.7.1 with Qml Quick 2.6.
It does not run on another pc where Qt does not install.
In logs I see this error:
"[WRN] QQmlComponent: Component is not ready".
In Windows's Task Manager I see app is running, but there is no window of app.
All qml files I put in resourse file.
new QQmlComponent(&(this->engine),
QUrl(QStringLiteral("qrc:/qml/design/qml/main.qml")));
Dirs with app looks:
When I start app on another PC, there are no any message with errors about depence of some dlls. Please help...

Getting the correct (and minimal) set of DLL binaries copied over to the target machine isn't the easiest thing. But there's standard documentation for it and a helper tool called windeployqt that you should check out.
http://doc.qt.io/qt-5/windows-deployment.html

Related

Deploying pyqt application to Windows using pyqtdeploy

I would like to deploy for the first time my first app made with PyQt5. I found pyqtdeploy (link) to be probably what I need to do this for Windows and other platforms.
Anyway, I am following this tutorial, but, as I am completely new to deploying applications, I am not sure on one thing: do I need to download Qt for the target specific platform I need to deploy my app to? If so, am I supposed to use qmake from that Qt installation against the result of pyqtdeploy? For example: if I want to deploy to Windows, do I have to download Qt from here (and which version???)?
From the same tutorial page, this is not so clear, maybe it's obvious, but as I am a newbie in this, not for me.
No you don't need to download Qt.
When building your 'sysroot.toml' file, pyqtdeploy will download qt-everywhere-src and builds it from source.
In the built sysroot directory you can find qmake executable in "...\Qt\bin" (qmake.exe) depends on where your project files (sysroot.toml file) are.
For example if your host machine is Windows and C:\Users\username\Desktop\My_PyQtDeploy_Proj is your project folder which contains sysroot.toml, after building sysroot you can find qmake in "C:\Users\username\Desktop\My_PyQtDeploy_Proj\sysroot-win-64\Qt\bin\qmake.exe"

Deploying Qt C++ Application from Visual Studio qwindows.dll error

I've been googling for a solution to this issue and although I've found many people sharing my problem none of their solutions work for me.
I wrote a C++ application using Qt framework using Visual Studio 2010. I built and ran the application in "Release" mode from Visual Studio without issue, but when I copy that exe from the Release folder to a new destination (pretend its a new PC) it fails to run providing this error:
---------------------------
TestApplication
---------------------------
This application failed to start because it could not find or load the Qt platform plugin "windows".
Available platform plugins are: windows.
Reinstalling the application may fix this problem.
Within the executable directory I have the following file structure:
./TestApplication.exe
./libGLESv2.dll
./Qt5Core.dll
./Qt5Gui.dll
./QtWidgets.dll
./platforms/qwindows.dll
./qt.conf
All dll files were taken from the 5.0.0 build of Qt in the Qtbase folder where the libraries reside.
The qt.conf file is:
[Paths]
Plugins=.
Without it, the launch error is the same except it says "minimal" and "offscreen" are available platforms as well.
For all other people experiencing this error it seemed to be solved by creating the platforms folder and putting in the qwindows.dll. But doing that myself doesn't change any behavior.
Is there something I've done wrong? Perhaps my method of generating the .exe in the first place is wrong?
If you are using libGLESv2.dll, then you must include libEGL.dll, too.
You can't see that in depends.exe, don't know how the Qt developers managed to hide this.
If your Qt is out of the box, then both Dlls are necessary even if you are not using OpenGL.
Also, if your Qt is out of the box, you need to include also the three ic*.dll, which contain information for Unicode handling.
You can see which DLLs are needed by looking at which ones are invoked when running Debug (F5) in Qt Creator.
=Carl
The release is likely missing a library/plugin or the library is in the wrong directory and or from the wrong directory.
Qt intended answer: Use windeployqt.
Qt comes with platform console applications that will add all dependencies (including ones like qwindows.dll and libEGL.dll) into the folder of your deployed executable. This is the intended way to deploy your application, so you do not miss any libraries (which is the main issue with all of these answers). The application for windows is called windeployqt. There is likely a deployment console app for each OS.

Can't start QT .exe file on Windows 7

I'm getting started with Qt and have encountered the following issue: when i compile and run my application from within QtCreator it runs all right, but when i go to the debug folder and double click .exe file to launch the app a message box pops up and it says
This application has failed to start because QtDeclaratived4.dll was not found. Re-installing the application may fix this problem
Please notice - it is QtDeclaratived4.dll with letter d before 4, not QtDeclarative4.dll.
After searching in Google i found an advice to find the needed dll and put it inside project folder. But unfortunately such .dll is missing on my computer. I found QtDeclarative4.dll and tried putting it inside project folder but it didn't help. Can you propose me any other solution?
The d in the name indicates the debug version of Qt, which means that you compiled your application using the debug build.
You probably have this DLL on your computer and Qt Creator knows where it is, that's why it is able to run your application. However, you don't have the path to this library configured in your PATH environment variable, that's you are not able to executable your application manually (i.e. outside Qt Creator).
To fix this issue, you have 2 choices:
Compile your application selecting the release build;
Or add the full path to QtDeclaratived4.dll to the PATH environment variable.
QtDeclarative4.dll can be found in C:\[QT_INSTALL_DIR]\bin
You should definitely have this if you used the standard Windows installer that Qt distrubutes.

DLL is missing when launching Qt GUI app

My app launches from inside Qt Creator no problem, but when I go into the debug folder, I
find the .exe file and I try to launch it, it complains that there is a missing DLL called mingwm10.dll.
I don't know how to fix this problem I tried the release as my build target, same thing happened.
Unless you compiled Qt statically and link to it statically, you will need to copy the Qt DLLs with your app when you go to deploy it to another computer, just copy the mingwm10.dll with them (it's in at least two places in my Qt install: <install path>\Qt\2010.02.1\mingw\bin and <install path>\Qt\2010.02.1\qt\bin).
For just running on your own machine, I would suggest you add the <install path>\Qt\2010.02.1\qt\bin path to your "Path" environment variable. This should allow your apps to run properly outside the IDE without having to copy the dll around for every project until you go to deploy it elsewhere.
I think, there are two ways to fix this. You can copy the mingwm10.dll from the MinGW directory to the directory of your exe file or you can recompile Qt without the dependency to mingwm10.dll (which seems to be used for thread safe exception handling). I found some information about it here: http://lists.trolltech.com/qt-interest/2006-08/thread00942-0.html

Qt creator won't run app after compiling

I checked out a Qt project hosted on google code with SVN to a local folder. When I opened it on Qt Creator, it managed to compile the project, but when it tried to run the compiled program, an error message came up on the application output:
The process could not be started!
What is wrong?
I solved this problem by going to projects>run settings and manually specifying the executable. Found this solution by googling, don't know if it's the proper way to fix this.
I assume you tried to run it manually and not from the IDE by pressing Ctrl+R, and I assume that it works when you're running it from the IDE. If that's the case, the problem is that the compiled application requires the Qt libraries and the runtime loader can't find them. When deploying the app, you need to copy the Qt libraries it links against to the application folder (on Windows), or you need to copy them to the app directory and launch it via a wrapper script which adds that directory to LD_LIBRARY_PATH (on Linux.)

Resources