This question already has answers here:
Deploy Qt5 QML application
(8 answers)
Closed 4 years ago.
Im trying to deploy a set of QT applications. On linux all applications works fine after installing all dependencies, but in windows QtQuick based applications doesn't work at all.
To deploy on windows I follow this steps:
Compile my project in release mode.
Add mingw to the system environment path
Run windeployqt.exe --release c:\myappdir\relesase\myapp.exe
When step 3 is finish I got a lot of dlls in the release folder Qt5Quick.dll among them. But myapp.exe doesn't work and didn't threw any error.
In order to get any extra information I add console to my CONFIG parameter under myapp.pro file and running myapp.exe by console I got this info:
QQmlApplicationEngine failed to load component
qrc:/main.qml:1 module "QtQuick" is not installed
qrc:/main.qml:-1 module "QtQuick" is not installed
qrc:/main.qml:1 module "QtQuick" is not installed
My version of QtSDK is 5.10.0 with MinGW so this solution doesn't work at all, I got more errors.
More over if I try to run myapp.exe without those dll in the root folder it works fine.
I been the whole day trying to find any solutions but nothing seems to work.
I'm pretty sure I missing something but I don't know whats is it.
Thanks
As I suppose, I was missing something. --qmldir option is needed in order to add QtQuick modules.
windeployqt.exe --qmldir . --release c:\myappdir\relesase\myapp.exe
That line did the trick,
Thanks #frank osterfeld and #Felix
Related
This question already has answers here:
Qt 5.1.1: Application failed to start because platform plugin "windows" is missing
(22 answers)
Closed 3 years ago.
I read a lot of questions and answers related to this issue. However, none of them solved my problem.
I would like to point out that i am using the 5.12.2 of Qt. In addition, i tried to generate .exe files using windeployqt command (Calling it via the cmd).
So, i have two different qt application (2 .exe files). I transfer them in a different windows machine with no Qt installation. One .exe file is running correctly however the other one gives me back the error related to the qt platform plugin "Windows".
I would like also to point out, that the running exe is produced using Qt 5.12.2 (MinGW 7.3.0 64-bit). For the problematic exe, the 5.12.2 (MinGW 7.3.0 32-bit) is used.
Do you know what will be the problem?
PS. i double check that the qwindows.dll is in the platforms folder. I also tried to put this dll in the same folder as the exe file as well as in a sub-folder called plugins (based on some answers find around the web.)
Thanks a lot,
I encountered this issue with PyQt5 5.11.3, Windows 10, Python 3.7.3; I got a similar error message:
qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "
This application failed to start because no Qt platform plugin could
be initialized. Reinstalling the application may fix this problem.
I set the following environment variable and then run the application. This Method had solved my question, I hope it is helpful for you:
name: QT_QPA_PLATFORM_PLUGIN_PATH
value: C:\Users\"your own user
name"\AppData\Local\Programs\Python\Python37\Lib\site-
packages\PyQt5\Qt\plugins\platforms
Are these exe files in the same folder ? If so you need to put the in 2 different folders as they will not use the same DLLs (including qwindows.dll). One exe needs 32-bit DLLs and the other one 64-bit DLLs.
If they are already in 2 seperate folders, make sure you have run the correct windeployqt on each of them.
You need to use the windployqt.exe from your "Qt 5.12.2 (MinGW 7.3.0 64-bit)" installation on the 64-bit exe. And use the windployqt.exe from your "Qt 5.12.2 (MinGW 7.3.0 32-bit)" installation on the 32-bit exe.
Also be sure to copy the Qt5Core.dll using windeployqt and not by doing a manual copy/paste. The reason is that windeployqt patches Qt5Core.dll when copying it so that it searches plugins relatively to your exe.
I have installed Shadowsocks-Qt5 within the code sudo apt-get install shadowsocks-qt5 in terminal, and then I can find the launch icon by searching, but it won't open when I click the icon. Then I tried to use terminal to open it, but the error comes out as below:
~ ss-qt5
Cannot mix incompatible Qt library (version 0x50501) with this library (version 0x50201)
[1] 8875 abort (core dumped) ss-qt5
I searched many answers but no one work. I think the key may be the default Qt library, but I don't know how to set default Qt library, the system on my computer is Ubuntu 14.04 LTS.
How to solve this problem?
I just had this error when attempting to run Qt Creator after doing a system update. For me, I was attempting to run Qt Creator 4.10.0-rc1 (based on Qt 5.13.1) that I had manually installed to ~/Qt along with Qt 5.13.0, and my system has Qt 5.12.2 installed.
I was getting the following error:
Cannot mix incompatible Qt library (version 0x50c02) with this library (version 0x50d00)
Doing an strace when running qtcreator.sh revealed that it was attempting to load plugins from the system directory. I finally discovered the culprit was the environment variable QT_PLUGIN_PATH was set (in my case to /usr/lib64/qt5/plugins:/usr/lib64/qt5/plugins/kcms).
After unsetting this variable, Qt Creator started up and worked.
After so many months of trying to fix this issue, this helped me.
sudo apt install qt5-style-plugins.
I was facing a similar issue, and even after 4 hours of debugging, I got nowhere. Finally, I found the following way to keep separate Qt versions, posting here so that other people find it.
Suppose you installed Qt in ${QtRoot}, extend the PATH and LD_LIBRARY_PATH:
export PATH=${QtRoot}/bin:${PATH}
export LD_LIBRARY_PATH=${QtRoot}/lib:${LD_LIBRARY_PATH}
You can make a wrapper function / script to manage separate Qt installations like this:
QtVersion=5.12.8
QtRoot="/scratch/Qt/${QtVersion}/gcc_64"
export PATH=${QtRoot}/bin:${PATH}
export LD_LIBRARY_PATH=${QtRoot}/lib:${LD_LIBRARY_PATH}
After running this your application will likely run fine.
I am running XUbuntu x64 14.04.4 LTS on my PC, with eclipse Mars.2 Release (4.5.2) and JDK 8 properly linked up to my eclipse (via ini file).
So basically, I "upgradet" to e(fx)clipse. Then I crated a new "JavaFX project". When I tried to run it, I got the error The import javafx.application cannot be resolved.
A quick google search brought up, that I need to add the jfxwt.jar from my java 1.8 directory (in my case /opt/Oracle_Java/jdk1.8.0_91/jre/lib/).
But the error didn't went away. I also tried the build options but nothing seemed to change anything.
First of all, I included the wrong jar. whoops. thanks to #DVarga for the tip.
But that wasn't the problem. So here are all the steps I took, to create a working e(fx)clipse environment:
Download the latest eclipse version and add the e(fx)clipse package.
Update to the latest JDK and reference that in the eclipse.ini file (1)
Tell ecplipse the path for the latest JDK. Although this tutorial is for MACs, it works pretty much the same in linux. There are a few differences tho:
The preferences menu is in window > preferences
The JRE type is not MacOS X VM but rather Standard VM
The JRE home path is the jdk1.8.0_VERSION folder (in my case /opt/Oracle_Java/jdk1.8.0_91)
I didn't need to add any other jar for javaFX to work properly.
(1) How to add the Java 1.8 path to eclipse
if you get the error "JavaFX was disabled because your java version is to old" (or something like this) you need to update to at least Java 1.8 and edit the eclipse.ini file in the eclipse folder.
There you have to look for the line -vm. In the next line is a path to an old Java version. Change that to the new path. It should look like this: /path/to/jdk1.8.0_VERSION/jre/bin/ in my case it is /opt/Oracle_Java/jdk1.8.0_91/jre/bin/
Essentially this is a repost of this question which was never answered. I am trying to set up Qt for static linking following these instructions.
So far, all I've done is go to where my Qt version is, and run
configure -static
I get some output, ending in:
Sources are in..............C:\QtSDK\Desktop\Qt\4.8.0\msvc2010
Build is done in............C:\QtSDK\Desktop\Qt\4.8.0\msvc2010
Install prefix..............C:\QtSDK\Desktop\Qt\4.8.0\msvc2010
Headers installed to........C:/QtSDK/Desktop/Qt/4.8.0/msvc2010/include
Libraries installed to......C:/QtSDK/Desktop/Qt/4.8.0/msvc2010/lib
Plugins installed to........C:/QtSDK/Desktop/Qt/4.8.0/msvc2010/plugins
Imports installed to........C:/QtSDK/Desktop/Qt/4.8.0/msvc2010/imports
Binaries installed to.......C:/QtSDK/Desktop/Qt/4.8.0/msvc2010/bin
Docs installed to...........C:/QtSDK/Desktop/Qt/4.8.0/msvc2010/doc
Data installed to...........C:/QtSDK/Desktop/Qt/4.8.0/msvc2010
Translations installed to...C:/QtSDK/Desktop/Qt/4.8.0/msvc2010/translations
Examples installed to.......C:/QtSDK/Desktop/Qt/4.8.0/msvc2010/examples
Demos installed to..........C:/QtSDK/Desktop/Qt/4.8.0/msvc2010/demos
WARNING: Using static linking will disable the use of plugins.
Make sure you compile ALL needed modules into the library.
Running syncqt...
I couldn't find a pro file for QtCore module
syncqt failed, return code 9
Please help
It's a known issue compiling Qt 4.8.0 from source.
Just delete syncqt.* in qt bin folder :
http://labs.qt.nokia.com/2011/12/15/qt-4-8-0-released/#comment-49942
http://labs.qt.nokia.com/2011/12/15/qt-4-8-0-released/#comment-49951
http://labs.qt.nokia.com/2011/12/15/qt-4-8-0-released/#comment-49953
I'm in the same situation of user963258 and I get the same error.
I deleted syncqt.* from qt bin folder, but I then get the same error
qmake gives code 3 when attempting to configure qt for static building
Why Qt4.8 has so many issues?
I have just purchased a Macbook (yes I am a complete noob on Mac though I have some considerable experience with Linux) and I'm trying to build my Qt application on it. I have installed XCode and the Qt SDK but when I try to build my project on Qt Creator all I get is the following error during qmake:
Running build steps for project TimeTracker...
Starting: "/usr/bin/qmake" /Users/raphaelcruzeiro/Documents/Projects/Timely/Widget/TimeTracker/TimeTracker.pro -r -spec macx-g++
Failure to open file: /Developer/Applications/Qt/Makefile
Unable to generate makefile for: /Users/raphaelcruzeiro/Documents/Projects/Timely/Widget/TimeTracker/TimeTracker.pro
The process "/usr/bin/qmake" exited with code %2.
Error while building project TimeTracker (target: Desktop)
When executing build step 'qmake'
Any ideas on what is going on? /Developer/Applications/Qt/Makefile indeed does not exist.
EDIT:
Ok, I know what is going on but I don't know how to fix it. When I ran qmake from the terminal everything went just fine. I believe that Qt Creator is trying to build my application on the Qt directory itself and it does nt have permission for it (it shouldn't anyway).
How do I tell Qt Creator where to build my application? I didn't find it anywhere and setting the DESTDIR variable isn't helping.
THE SOLUTION:
Deleting the .pro.user file made Qt Creator build the application to the directory specified in DESTDIR
THE SOLUTION:
Deleting the .pro.user file made Qt Creator build the application to the directory specified in DESTDIR
I was battling with the same thing. What helped eventually was resetting the default build directory here: