Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Can't run program from QT Creator says it exited or Cannot obtain a handle to the inferior
When I try to run my program it either says it exited with code 0 or it says Cannot obtain a handle to the inferior: The parameter is incorrect. I can take the built exe and run it just fine without QT Creator. I tried rebooting my pc, close/reopen QTCreator, building with different compiler, and cleaning the project.
What's going on here?
Macro last edited by
Once i had faced a problem like this... I just did like this.. go to Projects, and check your Qt Version and Tool Chain properties and change it to your needs... Then it worked fine for me... :)
The tool chains and things are set up, it builds just fine. And the exe it builds when run from the folder directly runs fine. But QT doesn't run it.
Macro last edited by
Does it says that any dll's required??
I deleted the build folders and the .user files, still doing the same thing after restart.
No, the .dlls are fine. Strangly I installed 2.6rc and it worked after setting up the kits, it built and run it fine a few times and now im getting the same error again.
I've uninstalled and reinstalled everything QT and still getting this problem. QT is not usable like this.
Amartel last edited by
I have the same problem. Qt 4.8.2 + Qt-Creator 2.5.2 under WinXp.
I ran into it in two projects: both console and finishes very quickly. One of them is a test project, the other - a console project, which does not call QCoreApplication::exec() (I checked a project, which calls it - no problem there).
After rebuilding - first launching finishes well. In all others qt-creator thinks that the program is still running (and writes "Cannot obtain a handle to the inferior" in debug console) though actually it does not.
It is annoying.
3.141592 last edited by
is there any solution to this problem?
I observed the same problem here, but the message only occurs during my QTest's.
I assume that the QTEST_APPLESS_MAIN sometimes runs into that error-message.
It seems to correlate with the presence or absence of a QCoreApplication, because if i use the same code within my Console-application the message never occurs.
Also Amartel mentioned, that his project using QCoreApplication runs without problems...
Should one file a Bug-Report here?
chakie last edited by
I see the same on Win7 using 5.0.1. For me there has been nothing but errors with 5.0.1. For instance debug/release paths are mixed up when building, this error, uic seems to create invalid ui_foo.h files etc.
monza last edited by
If you go to Projects -> build & Run and then check the Run settings, make sure that the Executable being called in the Run configuration is the same one for the build configuration e.g. ./debug/<your_app.exe> (use absolute path) for a debug configuration
wakeuky last edited by
There have been a few related issues. I had the "handle" issue among others when moving to 5.0.1. I resolved using the following steps.
- Clean project
- Close QtCreator
- Remove Release/Debug Folder from app directory
- Delete xxx.pro.user file (lives in app directory)
- Manually delete Makefile, Makefile.Debug, Makefile.Release (If still there)
- Open Qt Creator again and open your project. It should now be asking you to reconfigure your project build settings.
Also, check your environment variables – ensure they are updated for 5.0.1 paths.
"Reference to similar problem":http://qt-project.org/forums/viewthread/25326/
"Reference to another similar problem":http://qt-project.org/forums/viewthread/25058/
Thanks Wakeuky for step by step reply.
It is not working in my case.
I could debug/run my project; made some changes in the code and then this error appeared.
Can there any other reasons for this problem?
wakeuky last edited by
Hi tesmal4, it has been quite a while since I have seen this issue. This issue occurred for me when I had created a project under the 4.8.4 environment and tried opening the project under 5.0.1.
I am no using the latest 5.1.1 release and have had no issues of the sort. What version was your project created under?
What version are you currently trying to use?
Qt 4.7.4 for Desktop MinGW 4.4 and Qt Creator 2.4.1 . I did not change any configuration for the project. I only made changes in the cpp file.
I accidentally deleted DLL path. Now its working fine.
Thanks for your help and advice.
jcga last edited by
teslmai4: I have the same kind of problem with Qt 5.5.0. Can you please indicate what DLL path you delete?
Saber Lee last edited by
I have same issue.
And I copy my own DLL file to app-out-dir.
then this issue can to solute.
jayt last edited by
Seems likely that it is not a real "problem" but can be due to your application exiting too quickly when being run under QtCreator, please see this link