PDA

View Full Version : Qt application crash on startup



MacAssembly
16th August 2017, 07:29
I'm trying to compile a Qt project of mine written years ago but it froze on startup and despite using:


CONFIG += force_debug_info

The debugger console is empty:

12557

This is the flags of my .pro file:


QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets webkitwidgets network

CONFIG += c++11
CONFIG += force_debug_info

TARGET = myApp
TEMPLATE = app


My plataform is Windows 10/Intel 32-bit machine. What am I missing?

d_stranz
16th August 2017, 17:35
Did you actually build a debug version of your app? If you are using Qt Creator, are you running it in debug mode (that is, is your build target a debug build)?

Crashes on startup are usually due to trying to use an uninitialized or null pointer but could also be the result of accessing beyond the bounds of an array (eg. an incorrect index, or trying to read / write an uninitialized array). It won't be a bug in Qt.

MacAssembly
16th August 2017, 18:21
Yes, a build a debug version of my app and to make sure it's was a debug version I even added explicitly the -g flag. Tried both in debug and release versions. I understand it's probbly a null pointer or memory violation but not why Qt's debug view doesn't contain the debug information that are supposed to be there. What am I missing?
I'm on several days trying to fix it with no luck.

Added after 24 minutes:

Here's the moment of the error:

12558

I just nocied that the application crash even before the windows form/GUI have its original size (as designed in the app) so I thought it was something either in the C++'s main function or MainWindow's contructor then I commend each line in the MainWindow's constructor hoping to the crash stop... but even if the MainWindow's constructor is totally empty it still crashes.

EDIT: I also tried to download a previosly Qt version (5.0 current is 5.1) but I get the same error.

high_flyer
16th August 2017, 22:49
Put a break-point in the first line in main.cpp.
When it stops, have a look at the modules window, and look there for the Qt libs which are loaded.
See if the end up with 'd', like QtCored.dll
Then continue to to step line by line until you get to the crash.