Important: Please read the Qt Code of Conduct -

QwtPlot keeps crashing my program - "The program has unexpectedly finished."

  • And, I have no idea why, nor how to fix it.
    ( I'm actually pretty sure this is a really newbie problem too...)
    This was originally happing in another tutorial I was working on,
    and I eventually traced it back to the line:
    @ QwtPlot *plot = new QwtPlot();@

    Just to make sure, I create a new project to see if I could figure out what it was (not)doing
    (no luck)

    Everything builds, I'm working in QtCreator v 5.3, using MinGW, and on a windows OS.

    @#include "tutorial.h"
    #include <QApplication>
    #include <qwt_plot.h>

    int main(int argc, char *argv[])
    QApplication a(argc, argv);
    QwtPlot *plotc = new QwtPlot();
    return a.exec();

    // QApplication a(argc, argv);
    // Tutorial w;

    // return a.exec();

    .pro file
    QT += core gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = tutorial
    TEMPLATE = app

    SOURCES += main.cpp

    HEADERS += tutorial.h

    CONFIG += qwt

    #-the graphic library :
    INCLUDEPATH += C:/Qt/qwt-6.1.0/src
    LIBS += C:\Qt\qwt-6.1.0\lib\libqwt.a

    tutorial.cpp and tutorial.h I haven't touched
    @ //tutorial.cpp

    #include "tutorial.h"

    Tutorial::Tutorial(QWidget *parent)
    : QWidget(parent)



    @ //tutorial.h
    #ifndef TUTORIAL_H
    #define TUTORIAL_H

    #include <QWidget>

    class Tutorial : public QWidget

    Tutorial(QWidget *parent = 0);

    #endif // TUTORIAL_H

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Are you sure your qwt dll's can be found ?

  • I have the same question here:

Log in to reply