Results 1 to 4 of 4

Thread: Qt application crash on startup

  1. #1
    Join Date
    Aug 2017
    Posts
    7
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Windows

    Default Qt application crash on startup

    I'm trying to compile a Qt project of mine written years ago but it froze on startup and despite using:

    Qt Code:
    1. CONFIG += force_debug_info
    To copy to clipboard, switch view to plain text mode 

    The debugger console is empty:

    wFU1T.jpg

    This is the flags of my .pro file:

    Qt Code:
    1. QT += core gui
    2.  
    3. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets webkitwidgets network
    4.  
    5. CONFIG += c++11
    6. CONFIG += force_debug_info
    7.  
    8. TARGET = myApp
    9. TEMPLATE = app
    To copy to clipboard, switch view to plain text mode 

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

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qt application crash on startup

    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.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Aug 2017
    Posts
    7
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Windows

    Default Re: Qt application crash on startup

    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:

    Capture.jpg

    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.
    Last edited by MacAssembly; 16th August 2017 at 17:28.

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qt application crash on startup

    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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Qtcreator crash at startup on xubuntu
    By gerardpuducul in forum Qt Tools
    Replies: 4
    Last Post: 7th May 2015, 09:45
  2. QT app crash at startup
    By pl01 in forum Newbie
    Replies: 4
    Last Post: 5th June 2013, 10:45
  3. QT Designer startup crash after compilation (64-bit, MSVC2008)
    By yakaneli in forum Installation and Deployment
    Replies: 1
    Last Post: 13th December 2010, 07:11
  4. Installing add-on 1.1.7 causes VS2008 to crash on startup
    By danielweberdlc in forum Qt Tools
    Replies: 4
    Last Post: 7th December 2010, 20:36
  5. Showing a dialog at application startup
    By PaladinOfKaos in forum Qt Programming
    Replies: 3
    Last Post: 1st April 2008, 20:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.