Important: Please read the Qt Code of Conduct -

Raspian Stretch + Qt 5.7.1: Hello World crashes

  • Hi guys,
    I have a Raspberry Pi 3 model B with a brandnew stretch and Qt 5.7.1.
    When I compile a "Hello world" immediately after reboot "Hello world" works. After theat it always crashes:

    Starting /home/pi/schrott/build-untitled_1-Desktop-Release/untitled_1...
    qt5ct: using qt5ct plugin
    qt5ct: D-Bus global menu: no
    The program has unexpectedly finished.
    /home/pi/schrott/build-untitled_1-Desktop-Release/untitled_1 crashed. 

    Any idea?

  • Moderators

    build debug and use gdb to at least get a stacktrace.
    And some lines of code of yours would also help.

  • @raven-worx said in Raspian Stretch + Qt 5.7.1: Hello World crashes:


    Thank you for your help.
    Let me first say that I tried many newer Qt install versions on my Raspberry for which most of them never really worked. So maybe smething goes south during the installation process already.

    It's a standard out of the box hello world like:

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    MainWindow::MainWindow(QWidget *parent) :
        ui(new Ui::MainWindow)
        delete ui;


    #include "mainwindow.h"
    #include <QApplication>
    int main(int argc, char *argv[])
        QApplication a(argc, argv);
        MainWindow w;;
        return a.exec();


    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H
    #include <QMainWindow>
    namespace Ui {
    class MainWindow;
    class MainWindow : public QMainWindow
        explicit MainWindow(QWidget *parent = 0);
        Ui::MainWindow *ui;
    #endif // MAINWINDOW_H

    # Project created by QtCreator 2019-03-24T15:40:21
    QT       += core gui
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    TARGET = untitled_1
    TEMPLATE = app
    # The following define makes your compiler emit warnings if you use
    # any feature of Qt which as been marked as deprecated (the exact warnings
    # depend on your compiler). Please consult the documentation of the
    # deprecated API in order to know how to port your code away from it.
    # You can also make your code fail to compile if you use deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    SOURCES += main.cpp\
    HEADERS  += mainwindow.h
    FORMS    += mainwindow.ui

    I have set a brakepoint in mainwindow.cpp, line 6.

        ui(new Ui::MainWindow)

    Debugger console gives me:

    Debugging starts
    &"warning: GDB: Failed to set controlling terminal: Unpassender IOCTL (I/O-Control) f\303\274r das Ger\303\244t\n"
    Unable to find dynamic linker breakpoint function.
    GDB will be unable to debug shared library initializers
    and track explicitly loaded dynamic code.Could not load shared library symbols for 32 libraries, e.g. /usr/lib/arm-linux-gnueabihf/
    Use the "info sharedlibrary" command to see the complete listing.
    Do you need "set solib-search-path" or "set sysroot"?
    qt5ct: using qt5ct plugin

    The debugger is unchartered waters for me. No idea what really happens at the moment.

Log in to reply