Basic Qt app crashes upon launch - c++

When I launch a basic Qt app within Eclipse, it crashes with a ".exe has stopped working" error.
The context :
its the basic app obtained when creating a Qt GUI project (with a MainWindow), nothing was changed in it, haven't even added a button
PATH has all the necessary stuff (mingw, msys, qt)
project properties and eclipse paths should be ok too (c++, qt, mingw)
the .pro file is ok, no file missing
clean & rebuild, as well as relaunching eclipse doesn't resolve the problem
upon compilation there is no error, just an ignored "cannot lstat `ui_.h': No such file or directory". No relevant result found when searching around that.
if launched, stops with the afforementionned error. Details show its the app that crashed, with error code c0000005, offset 00002cb20. Search results tells me c0000005 is access violation, but where would that come from ? It's the basic app...
tried to launch with eclipse being in admin mode to prevent accesss violation, didn't help
if launched in debug mode, stops with error "Can't find a source file at ../mingw/main.c". I thought I forgot something when I installed mingw, so I did its setup again, but that did not create that file. No relevant search results here either.
my setup: eclipse classic x32 with c++ & php stuff, qt 4.8, win7 x64
I'm getting lost here. I already worked with Qt under Eclipse before (on winXP and vista), got my bunch of installing problems but this one is a first. Anybody went through this already ? Any leads on how to find where the access violation is happening ? Reading this question makes me think it's a Qt Eclipse Integration problem, but how can I circumvent that ?
Thanks for any leads !

Your project doesn't have a TARGET = set in the .pro file. This was probably caused by an Eclipse/Qt plugin wizard screw up, so just typing a new target may not work, other files may have to be renamed manually.
FWIW development on the Qt plugin for Eclipse was halted some time ago, building outside of Qt Creator is definitely one way of making life more difficult for yourself.

Related

Cannot run Qt C++ release build. 'The procedure entry point could not be located'

I am trying to deploy my Qt application and have run into a fatal error. The program works fine in the Qt editor, I can build and run it. After building my project in release mode and using windeployqt.exe to get the correct .dll's in the folder, I am treated to this error message. I get one for 5 different Qt .dll's. I found a way to remove this error by using the .dll's from Qt tools instead of the ones found in the compiler's bin directory. But, I am left with a remaining error like this. Unlike the previous errors', there is no dll being cited, only my program's directory.
I've tried this with 2 compilers by now. That which is provided by Qt, and my own installation. Both you can tell, have failed.
I had a similar problem few years ago when I was just learning QT. What I tried which did worked is that to move the .exe generated file to the location from where you copy paste the dlls and it worked like charm. You are getting the wrong dlls copied (perhaps). Try searching for correct ones on google!!

Qt crashes when I try to execute any program

I've looked for an answer during a few days and I haven't found anything similar anywhere;
I downloaded Qt from the official website, installed it and apparently compiling is fine. But whenever I try to execute (Ctrl+R) any app, even the basic one which only displays a window or widget, QtCreator itself crashes. No error message, nothing, just crashing.
I've tried to redownload and reinstall it a few times with different settings, but nothing will do.
I'm running QtCreator on Windows 7 64 bits. I'll try on my laptop which is also running windows and will update if I find anything.
Any help would be appreciated, I need to start a project as soon as possible. I'm relatively new to QT and if you need info on anything just ask me. Thanks :)
Use dependency walker, http://www.dependencywalker.com/
and post any missing dependencies. It is possible some install targets or options are missing from when you installed QtCreator, which can be resolved with the maintenance tool in the same directory you installed Qt.
Also, are you using the Visual Studio compiler(must have Visual Studio installed separately, and mark the option during install), or the Ming compiler(2 options checked during install or maintenance)?
Check if your antivirus is locking it, I had a similar issue time ago and it was due to antivirus (Avast specifically). Disable antivirus' realtime shields and try to execute a basic app.
It is necessary to use QtCreator? I use QtDesigner snd VS2013 and things go very well. :)
check this thread Qt Creator Plain C++ Project won't run/debug... and this C++ - QtCreator doesn't show any output

Serious issue with starting application in QtCreator

I have been writing an application for two years in QtCreator. (My application uses some external libs).
Recently I've ported the application into Qt5.3mingw(windows7). The application built successfully but failed to start within QtCreator and gave "The program has unexpectedly finished.".
With debugging the application, it gives this error message: "During startup program exited with code 0xc0000135".
However the application starts succussfully outside of QtCreator! It seems the QtCreator has severe problem in starting the application or it's the linker problem.
I've even uninstalled all Qt and QtCreators and re-installed them, but the problem insists.
Any guide will be appreciated. Thanks.
Status code 0xC0000135 is STATUS_DLL_NOT_FOUND.
There's some DLL that your program is dependent on that is not in a directory being searched when launched from the QtCreator IDE.
You may need to make sure the PATH is set correctly for QtCreator.
Also, a tool like Dependency Walker may be able to help you figure out what DLL is the problem. I'm not sure why Windows doesn't make it easier to find out what DLL can't be found.

C++ application fails to start correctly (0xc000000d)

I'm writing a C++ application using VS2010 on two dev computers - both are Win7 64bit SP1. I use git to sync the repositories.
On one of the machines the compiled executable (and also the test exec) stopped working with the following error, while on the other machine it works fine and I'm able to continue development.
The application was unable to start correctly (0xc000000d). Click OK to close the application.
I tried deleting the repository and cloning it again. I also made sure I have the same versions of Boost, git, Visual Studio. Also, I tried debugging (stepping in) but the error occurs before any line of code is reached.
Notice as far as I understand I'm tracking Visual Studio's solution\project configuration files as detailed here.
I'm at a loss, how would you debug this?
UPDATE 1:
Only the Debug version fails to run. The Release version runs fine
UPDATE 2: The executable that doesn't work does work on the other computer!
UPDATE 3: I've reinstalled VS2010 (exactly the same version) - didn't help. Surprisingly the compiled files are not the same size between the two machines.
I got the same problem as you mentioned.
My solution:
Clean the manifest file and rebuild
In the property page-> Manifest tool -> make sure "Additional Options" is set to nothing.
(I set it as "/validate_manifest" before).
Or you can try "Embed Manifest -> NO", rebuild and then set back to Yes. It sounds to be ridiculous, but it really works sometimes. I don't know why.
I got the same phenomenon suddenly without a warning on Win7 / VS2010 / C++. Debug App couldn't be launched, got 0xC000000D at initializing and loading multiple dlls. Found one base dll of my own responsible, played around with linker settings. Modifying settings, incremential rebuild -> app starts, rebuild all -> app crashes again. After setting "generate manifest" to "no" in the linker settings the sample app works, but the main app still crashes. After setting "generate manifest" to "no" for the most of my dlls -> the app starts in debug mode again. The stuff is very spurious, because some dlls need the modified settings others do not.
Have a look at the top two answers to this question
Program crashes with 0xC000000D and no exceptions - how do I debug it?
On the machine where it fails, try running the debug executable NOT under the debugger, and update your question to say what happens. If it crashes, are you able to then attach the debugger whilst the message box is still there and get a stack trace that tells you what function it is crashing in?
This is the weirdest thing....
Try deleting the "ipch" directory and then rebuilding.
Hope it works for you, I have wasted hours on this.
disabling/enabling precompiled headers fixed the issue for me.
I was facing crash on Debug x64 only - I guess it was related to an upgrade from boost 1.50 to 1.52, while keeping pch files.
in my case i got it working again by setting generate manifest to NO on all projects
I have changed "Embed manifest" setting to NO and then back to YES but it didn't help.
For me setting General->Platform Toolset to Windows SDK 7.1 for my program and all dependent libraries compiled with it helped.
It's the ipch just delete the entire folder and it will clear it up. I was confused for a while too.
I saw the error while using OpenCV library compiled with MSVC2010 in a project running on MSVC2015. Changing project configuration properties->General->Platform toolset from Visual Studio 2015(v140) to Visual studio 2010(v100) resolved the error.

Eclipse debugger: ".settings does not exist" error

I am developing a C++ application in Eclipse under Ubuntu Linux 10.10. When I launch the application that I develop in debug mode then Eclipse correctly switches to the debug perspective, but it tries to open a file (?) called ".settings", which does not exist in my project directory (but there is indeed a directory with that name there). I can see that Eclipse supends the running thread at the right source code location (based on the stack trace), but that source file is not opened, nor does the "debug step" move the current instruction pointer to the next statement.
It basically seems to be the same error as here: http://dev.eclipse.org/newslists/news.eclipse.tools.cdt/msg08774.html -- unfortunately the solution there is to update Eclipse to 3.1.5, but I am using version 3.5.2 already, so that does not do the trick for me.
Any suggestions?
Thanks in advance, Matthias
Try to open all projects that are on the source file's path. I've experienced something similar with Java and a hierarchical project and that did solve my problem.