The inferior stopped because it triggered an exception



  • I am using Qt 4.8.6 , Qt creator 3.4.1 , compiler msvc2008 in an windows 7 operating system .
    when a try to run a new created project i get an error

    Exception Triggered

    <p>The inferior stopped because it triggered an exception.<p>Stopped in thread 0 by:
    Exception at 0x64f7e49c, code: 0xc0000005: read access violation at: 0x0, flags=0x0 (first chance).
    OK

    Code is listed below

    mainwindow .h

    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H
    #include <QMainWindow>
    #include <QApplication>
    #include <QWidget>

    namespace Ui {
    class MainWindow;
    }

    class MainWindow : public QMainWindow
    {
    Q_OBJECT

    public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    private:
    Ui::MainWindow *ui;
    };

    #endif // MAINWINDOW_H

    main.cpp file

    #include "mainwindow.h"
    #include <QApplication>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;
    w.show();
    return a.exec();
    }

    mainwindow.cpp

    #include "mainwindow.h"
    #include "ui_mainwindow.h"

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }


  • Lifetime Qt Champion

    Hi,

    Run your application through the debugger, it will tell you where there's a problem



  • @SGaist
    Hi . It just gives me the The inferior stopped because it triggered an exception which points to
    QApplication a(argc, argv);

    Is it because i have two version of Qt installed ??
    Qt 4.8.6 for msvc 2008 and Qt 4.8.6 for msvc 2010 installed


  • Lifetime Qt Champion

    No it should not, unless you've mixed the compilers in your Kit



  • @SGaist

    I have 2 Qt installed Qt 4.8.6 for msvc 2008 and Qt 4.8.6 for msvc 2010
    Two compilers Microsoft Visual Studio 10.0 and Microsoft Visual Studio 9.0
    3 debuggers windows kits 10(version 10.0), windows kits 8.0(version 6.2) and Debugging Tools for Windows (x86) (version 6.11)

    I have 2 combination of kits.
    1)Desktop_msvc2008
    Qt-4.8.6 for msvc 2008
    compiler-Microsoft Visual Studio 9.0
    debugger-Debugging Tools for Windows (x86) (version 6.11)

    Which gives me "The CDB process terminated) error''

    2)Desktop_msvc2010
    Qt-4.8.6 for msvc 2010
    compiler-Microsoft Visual Studio 10.0
    debugger-windows kits 8.0(version 6.2)

    which gives me "The inferior stopped because it triggered an exception".

    Did i configure kits correctly ??


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.