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

    @timertick_t
    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:

    stacktrace

    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:
    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;
    }
    

    main.cpp:

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

    mainwindow.h:

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

    untitled.pro:

    #-------------------------------------------------
    #
    # 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.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # 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\
            mainwindow.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/libarmmem.so.
    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
 

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