[SOLVED] NEW and CONFUSED
-
[quote author="JKSH" date="1375097634"][quote author="vtong" date="1375093795"]I also have the same problem.
My Application is based on Qt5.1
My system used:- Qt5.1
- Mingw32
I can't find the mingw10.dll and libgcc_s_sjlj-1.dll in C:\Qt-51\Qt5.1.0\Tools\mingw48_32\bin.
Please help to deploy application compiled in mingw to other window PC.[/quote]Which Qt package did you download? (Please provide the full link)
Where did you install MinGW?[/quote]
Thanks for your response.
I downloaded the Qt5.1 from: http://download.qt-project.org/official_releases/qt/5.1/5.1.0/qt-windows-opensource-5.1.0-mingw48_opengl-x86-offline.exe
After I installed, I have a folder: C:\Qt\Qt5.1.0
I used all library from: C:\Qt\Qt5.1.0\5.1.0\mingw48_32\bin
I searched and found a lot solution but no ones work for me.
Note: I use Qwt-6.1.0 in my application, I build and install it by Command Prompt from Qt the I installed -
The MinGW in that package uses Dwarf-2 instead of SJLJ, so replace libgcc_s_sjlj-1.dll with libgcc_s_dw2-1.dll.
Also, MinGW has changed: you don't need mingwm10.dll anymore, but you now need libwinpthread-1.dll
-
@JKSH: Thanks for your advice.
I did copy all the files you mention to application folder, I all so put platform folder as well.
But somehow the application still show Visual C++ Runtime error when I run it in other PC.
Very confused now.
Please advice.
Thanks -
If it's showing a Visual C++ error, that means your binary was compiled with Visual Studio, not MinGW... Check that:
You are using the correct Qt package
You are using the correct compiler
-
I used MingW, to make sure nothing wrong, I removed the msvc-2010 from the Qt installed directory, but the error still happened.
It pop up a window with message: "This application has requested the Rumtime to terminate it in an unsual qat. Please contact...." -
"This application has requested the Runtime to terminate it in an unusual way" is definitely a Visual Studio message. You need to clean your environment.
Uninstall all versions of Qt except for the MinGW one. Remove Visual Studio from your PATH. Delete your *.o and *.exe files and recompile.
If you still can't solve the problem, uninstall Visual Studio and try again.
-
Hi JKSH,
I did all things you mention, but when I run my app on another PC, it pop up another message: "The application failed to start because it could not find or load platform plugin "windows". Reinstalling the application may fix this problem"
When I click OK, it come with Visual C++ Runtime library error.
Don't know why this happen, even I copy the platforms/qwindows.dll from mingw_32/bin.
Any idea to fix this? -
Can you run the application from your development PC, in Qt Creator?
Can you run the application from your development PC, outside of Qt Creator (double-click the .exe)?
Did you install Qt on your other PC? You must not have Qt in your PATH. If you do, your application might try to use the wrong version of DLLs.
qwindows.dll must be in a subfolder:
myapp\myapp.exe
myapp\Qt5Core.dll
myapp\platforms\qwindows.dll -
[quote author="JKSH" date="1375235308"]# Can you run the application from your development PC, in Qt Creator?
Can you run the application from your development PC, outside of Qt Creator (double-click the .exe)?
Did you install Qt on your other PC? You must not have Qt in your PATH. If you do, your application might try to use the wrong version of DLLs.
qwindows.dll must be in a subfolder:
myapp\myapp.exe
myapp\Qt5Core.dll
myapp\platforms\qwindows.dll[/quote]I put app and dlls as the same as your suggestion.
To answer your questions:
1/ I can run the app from Qt Creator (Press Run button).
2/ I can't run the app outside Qt Creator, double-click exe from Release folder or from other folder, I must copy all requred dlls to the app folder to make it run.
3/ The other PC is fresh, no Qt Installed. -
[quote author="vtong" date="1375244963"]
[quote author="JKSH" date="1375235308"]# Can you run the application from your development PC, in Qt Creator?Can you run the application from your development PC, outside of Qt Creator (double-click the .exe)?
Did you install Qt on your other PC? You must not have Qt in your PATH. If you do, your application might try to use the wrong version of DLLs.
qwindows.dll must be in a subfolder:
myapp\myapp.exe
myapp\Qt5Core.dll
myapp\platforms\qwindows.dll[/quote]I put app and dlls as the same as your suggestion.
To answer your questions:
1/ I can run the app from Qt Creator (Press Run button).
2/ I can't run the app outside Qt Creator, double-click exe from Release folder or from other folder, I must copy all requred dlls to the app folder to make it run.
3/ The other PC is fresh, no Qt Installed.[/quote](UPDATE):
I just do REcompile with a fresh project from my github:
I clean all file from Release folder, remove some path in PATH, remove Visual Studio.
Recompile and Run from Qt Creator, it show the Visual C++ Runtime Library.
Please advise, thanks -
Hmm... Please open your project in Qt Creator and provide screenshots of the following:
- (Top menu bar) -> Tools -> Options -> Build & Run -> Compilers
- (Top menu bar) ->Tools -> Options -> Build & Run -> Kits
- (Left menu bar) -> Projects
quote author="vtong" date="1375245456":
I just do REcompile with a fresh project from my github:[/quote]Is this the same project that you are trying to run on your other PC? Can you provide a GitHub link?
-
I did an experiment by uninstall all Qt from my PC then run the app
myapp/app.exe
myapp/*dll (all dlls required to run the app)
myapp/platforms/qwindows.dllThe error message appeared.
Then I Re-Install Qt5.1 MingW32
The App run OK, withou error message.
Do you have any idea?
I did check the Path in Environment Variables, don't have any value related to Qt installed folder. -
Hi JKSH,
I used Process Monitor program then I found something interesting:- The Application has error always used files from Qt Install Directory, e.g: platforms.
- I create a similart app, It uses files from directory that I copy.
Here is the situaton, all file in a folder in D drive, Qt Install in C:\Qt:
D:\MyProject
MyApp.exe
*.dll (All required dll: Qt5Core.dll, Qt5Gui.dll,...
platforms/qwindows.dll
MySimilarApp.exe
If I rename Qt5.1 to Qt5.1___ (for example)
MyApp.exe ran with error.
But when I return the name to origial one: Qt5.1, MyApp.exe ran withou error.
MySimilarApp.exe ran without error, don't care the Qt5.1 folder name.
I don't know why this happened.
-
Very strange... I've never seen that before.
You said MySimilarApp.exe is ok. What happens if you re-compile Qwt and MyApp.exe after you uninstalled and reinstalled Qt 5.1?
-
[SOLVED]
I solved the problem.
The error caused by some QImage Variables I declared at the top of mainwindow.cpp (after #include, of course).
By moving these variables to mainwindow.hpp, it works perfectly.
Special thanks to:
JKSH for your willingness to support me.
Process Monitor enabled me to captured and isolated the root cause.