Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. QtonPi
  4. Qt 5 cross compiled application not working on Raspberry Pi
QtWS25 Last Chance

Qt 5 cross compiled application not working on Raspberry Pi

Scheduled Pinned Locked Moved QtonPi
4 Posts 2 Posters 5.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    harshshah5789
    wrote on 30 Jul 2013, 04:50 last edited by
    #1

    I used the ./bakeqtpi.bash script to install toolchain for Raspberry Pi by reading this page http://qt-project.org/wiki/RaspberryPi_Beginners_guide

    I also configured the Qt Creator as mentioned in the page, added new kit and was able to successfully to cross compile.

    Then using these steps :
    @sync; sudo umount /mnt/rasp-pi-rootfs
    sudo dd bs=1M if=2012-07-15-wheezy-raspbian.img of=/dev/sdb; sync@

    I prepared the SD card and also copied my application binary in /home/pi/ folder in SD card.

    Then I inserted the SD card in Rasp Pi and booted it after connecting to HDMI monitor.

    The linux started successfully also 1st time config screen also came. I expanded the root fs and rebooted.

    Then on the console I ran:
    @cd /home/pi/
    ./App1
    This plugin does not support setParent
    This plugin does not support setParent
    This plugin does not support setParent
    This plugin does not support setParent@

    I also tried :
    @./App1 -qws
    This plugin does not support setParent
    This plugin does not support setParent
    This plugin does not support setParent
    This plugin does not support setParent@

    But the same result.

    My application is a simple app which has a textbox and button.

    1 Reply Last reply
    0
    • P Offline
      P Offline
      postmako
      wrote on 30 Jul 2013, 11:54 last edited by
      #2

      Could you post your source code for your simple project?

      1 Reply Last reply
      0
      • H Offline
        H Offline
        harshshah5789
        wrote on 30 Jul 2013, 15:29 last edited by
        #3

        [quote author="postmako" date="1375185276"]Could you post your source code for your simple project?[/quote]

        Here it is :
        widget.ui
        @<?xml version="1.0" encoding="UTF-8"?>
        <ui version="4.0">
        <class>Widget</class>
        <widget class="QWidget" name="Widget">
        <property name="geometry">
        <rect>
        <x>0</x>
        <y>0</y>
        <width>400</width>
        <height>300</height>
        </rect>
        </property>
        <property name="windowTitle">
        <string>Widget</string>
        </property>
        <widget class="QLineEdit" name="lineEdit">
        <property name="geometry">
        <rect>
        <x>140</x>
        <y>70</y>
        <width>113</width>
        <height>23</height>
        </rect>
        </property>
        </widget>
        <widget class="QPushButton" name="pushButton">
        <property name="geometry">
        <rect>
        <x>160</x>
        <y>120</y>
        <width>80</width>
        <height>23</height>
        </rect>
        </property>
        <property name="text">
        <string>PushButton</string>
        </property>
        </widget>
        </widget>
        <layoutdefault spacing="6" margin="11"/>
        <resources/>
        <connections/>
        </ui>
        @

        widget.h
        @#ifndef WIDGET_H
        #define WIDGET_H

        #include <QWidget>

        namespace Ui {
        class Widget;
        }

        class Widget : public QWidget
        {
        Q_OBJECT

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

        private:
        Ui::Widget *ui;
        };

        #endif // WIDGET_H
        @

        widget.cpp
        @#include "widget.h"
        #include "ui_widget.h"

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

        Widget::~Widget()
        {
        delete ui;
        }
        @

        main.cpp :
        @#include "widget.h"
        #include <QApplication>

        int main(int argc, char *argv[])
        {
        QApplication a(argc, argv);
        Widget w;
        w.show();

        return a.exec&#40;&#41;;
        

        }
        @

        1 Reply Last reply
        0
        • P Offline
          P Offline
          postmako
          wrote on 30 Jul 2013, 23:19 last edited by
          #4

          I compiled your code on my Raspberry Pi and had to make a few changes in the widget.ui file and I included the .pro file I used with qmake. Those files are as follows and the source files are the same as yours. I also used this link ("http://qt-project.org/wiki/Native_Build_of_Qt5_on_a_Raspberry_Pi":http://qt-project.org/wiki/Native_Build_of_Qt5_on_a_Raspberry_Pi) to build qmake on the pi. I ran the sample app, and it wasn't pretty, but it worked in both the console and in x-windows. Let me know if any of these help you.

          widget.ui
          @<?xml version="1.0" encoding="UTF-8"?>
          <ui version="4.0">
          <class>Widget</class>
          <widget class="QWidget" name="Widget">
          <property name="geometry">
          <rect>
          <x>0</x>
          <y>0</y>
          <width>400</width>
          <height>300</height>
          </rect>
          </property>
          <property name="title">
          <string>Widget</string>
          </property>
          <widget class="QLineEdit" name="lineEdit">
          <property name="geometry">
          <rect>
          <x>140</x>
          <y>70</y>
          <width>113</width>
          <height>23</height>
          </rect>
          </property>
          </widget>
          <widget class="QPushButton" name="pushButton">
          <property name="geometry">
          <rect>
          <x>160</x>
          <y>120</y>
          <width>80</width>
          <height>23</height>
          </rect>
          </property>
          <property name="title">
          <string>PushButton</string>
          </property>
          </widget>
          </widget>
          <layoutdefault spacing="6" margin="11" //>
          <resources //>
          <connections //>
          </ui>@

          simple_widget.pro
          @QT += widgets

          FORMS = widget.ui
          HEADERS = widget.h
          SOURCES = main.cpp
          widget.cpp

          unix:!mac:!vxworks:!integrity:LIBS += -lm

          install

          target.path = ./simple_widget
          INSTALLS += target@

          1 Reply Last reply
          0

          2/4

          30 Jul 2013, 11:54

          • Login

          • Login or register to search.
          2 out of 4
          • First post
            2/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved