[SOLVED] NEW and CONFUSED
-
"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.