sachusanal
Posts: 29
Joined: Thu Jun 25, 2015 10:51 am

QT application running reg

Wed Jul 01, 2015 5:08 am

Hello sir ,
I am new in rawsperry pi using . i developed on Qt application in my PC . i need to run this application on Rawsperry pi board . let me know what i need to do? for running Qt application on the board

Heater
Posts: 16338
Joined: Tue Jul 17, 2012 3:02 pm

Re: QT application running reg

Wed Jul 01, 2015 10:00 am

You need to install the qt4 devlopment libraries and tools on the Pi. There are instructions for doing that here:
http://gettingstartedqtdebian.blogspot. ... t-for.html

I normally don't install the qtcreator ide, so no qtcreator package. But I think you need to install qmake separately in that case.

Then just copy your code onto the Pi change to it's directory and build it:

$ qmake
$ make

Good luck.
Memory in C++ is a leaky abstraction .

sachusanal
Posts: 29
Joined: Thu Jun 25, 2015 10:51 am

Re: QT application running reg

Mon Jul 13, 2015 4:24 am

hai sir ,
I am referring https://wiki.qt.io/RaspberryPi_Beginners_Guide this link for running qt application on my raspberry board. but when i follow this step git clone git://gitorious.org/cross-compile-tools/cross-compile-tools.git i didnt get cross-compile tools.
i get an error like Cloning into 'cross-compile-tools'...
fatal: unable to connect to gitorious.org:
gitorious.org[0: 109.107.38.78]: errno=No route to host
gitorious.org[1: 2a02:c0:1014::1]: errno=Network is unreachable


then i try another link for cross compile tools
git clone https://gitorious.org/cross-compile-too ... -tools.git
Cloning into 'cross-compile-tools'...
error: Failed connect to gitorious.org:0; Connection timed out while accessing https://gitorious.org/cross-compile-too ... pload-pack
fatal: HTTP request failed


please help me to solve this issue...

myoung008
Posts: 55
Joined: Mon Mar 18, 2013 9:56 pm

Re: QT application running reg

Mon Jul 13, 2015 4:52 am

gitorious is down. They are in the middle of migrating data to the Internet Archive, at which point you should be able to clone the repository again.

sachusanal
Posts: 29
Joined: Thu Jun 25, 2015 10:51 am

Re: QT application running reg

Mon Jul 13, 2015 5:21 am

let me know when i can access this site, or any other site is available for this cross compile tool, i am building qt for rasperry pi by using this cross compile

Heater
Posts: 16338
Joined: Tue Jul 17, 2012 3:02 pm

Re: QT application running reg

Mon Jul 13, 2015 6:01 am

sachusanal

You are being confusing. Do your really want to be able to cross compile Qt apps for the Pi on your PC or do you just want to run them on the Pi?

Your opening question implies the latter. If so you can install the Qt dev tools on the Pi itself and build your programs on the Pi. No cross compiling required. You would already have your programs running if you did this. See instructions linked from my previous post.
Memory in C++ is a leaky abstraction .

sachusanal
Posts: 29
Joined: Thu Jun 25, 2015 10:51 am

Re: QT application running reg

Tue Jul 14, 2015 4:02 am

Hi,
http://gettingstartedqtdebian.blogspot. ... t-for.html
i go through this link, i am using Qt 5 could u please give me the Qt 5 setting step.
I have some more doubt also
now i run Debian Wheezy image on my board.
what are the steps i need to run after that, just instll the package is enough tne after that what i need to done. need to install qt creater ?

Heater
Posts: 16338
Joined: Tue Jul 17, 2012 3:02 pm

Re: QT application running reg

Tue Jul 14, 2015 5:59 am

sachusanal,

Those getting started instructions you link to are for installing the normal, prebuilt, packages of Qt4 on Debian. You should have mentioned that you need Qt5 at the beginning, that changes everything. There is no package of Qt5 for Wheezy available in the standard OS. So what to do?:

One way is to build your own Qt5 installation on the Pi form it's source code as described here: https://wiki.qt.io/Native_Build_of_Qt5_ ... spberry_Pi. This is what I did about a year ago and it works well. Only problem is the build process is quite complex and took nearly two days to run on my old Pi! Should be down to 8 hours or so on the Pi 2 (There is an update to those instructions here. http://wiki.qt.io/Native_Build_of_Qt_5. ... spberry_Pi)

I have made some notes on doing that Qt5 build here http://the.linuxd.org/qt-5-2-for-raspberry-pi/ where I also link to the resulting Qt5.2 binary that you can use immediately.

Another way is to install the Qt5.3 deb packages from here https://twolife.be/raspbian/

Finally there is no need to install qtcreator on the Pi unless you actually want to use that IDE on the Pi. You can simply put your projects source code on the Pi and use the "qmake" and "make" commands to build it. As shown in my blog post.

Oh, I would suggest you use Raspbian on the Pi not Debian. All those instructions given above are known to work on Raspbian, they should also work on Debian but who knows.
Memory in C++ is a leaky abstraction .

sachusanal
Posts: 29
Joined: Thu Jun 25, 2015 10:51 am

Re: QT application running reg

Tue Jul 14, 2015 11:50 am

Hai Thanks for your reply

I followed this document http://the.linuxd.org/qt-5-2-for-raspberry-pi/ for setting qt
Use the built package.

The complete Qt5.2 package ready to use is posted to DropBox and can fetched and installed as follows:

$ wget https://dl.dropboxusercontent.com/u/812 ... .2-rpi.tgz
$ tar xvzf qt5.2-rpi.tgz
$ rm qt5.2-rpi.tgz
$ sudo mv qt5 /opt
$ ln -s /opt/qt5 /usr/local/qt5

You will need to set some environment variables, This can be done by adding the following to /etc/profile or your ~/.bashrc file.

$ export PATH=${PATH}:/usr/local/qt5/bin
$ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/qt5/lib
$ export QT_PLUGIN_PATH=/usr/local/qt5/plugins


I completed up to this step.how can check the memory ?
what change needed in memory split. please help me.
after that i copied my Desktop running qt application source folder to my /home/pi location
how can execute my application

Heater
Posts: 16338
Joined: Tue Jul 17, 2012 3:02 pm

Re: QT application running reg

Tue Jul 14, 2015 2:11 pm

sachusanal,

I don't think you need to make any changes to the memory split to use the package. I had to do that when I was building it. But if you want to play with the memory split it's done with the raspi-config tool on Raspbian. I guess you have to fiddle with some boot config on Debian.

Before you can run your application you will need you will need to compile it.

Change into your projects source directory and type the following command:

$ qmake

followed by:

$ make

You should now have an executable to run in that directory.
Memory in C++ is a leaky abstraction .

sachusanal
Posts: 29
Joined: Thu Jun 25, 2015 10:51 am

Re: QT application running reg

Wed Jul 15, 2015 4:26 am

Hai ,

I followed up to this step.
$ wget https://dl.dropboxusercontent.com/u/812 ... .2-rpi.tgz
$ tar xvzf qt5.2-rpi.tgz
$ rm qt5.2-rpi.tgz
$ sudo mv qt5 /opt
$ ln -s /opt/qt5 /usr/local/qt5

You will need to set some environment variables, This can be done by adding the following to /etc/profile or your ~/.bashrc file.

$ export PATH=${PATH}:/usr/local/qt5/bin
$ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/qt5/lib
$ export QT_PLUGIN_PATH=/usr/local/qt5/plugins

then I copied my application in /home/pi
i enter to my Application directory
enter qmake

but i get an error like -bash:qmake:command not found

i try make command also
that time i get an error like make no target specified no makefile found

Heater
Posts: 16338
Joined: Tue Jul 17, 2012 3:02 pm

Re: QT application running reg

Wed Jul 15, 2015 6:20 am

OK, if qmake is not found there is either something wrong with your PATH environment variable or the qmake executable is not in /opt/qt5/bin or the symbolic link /usr/local/qt5 is not pointing to /opt/qt5. So we have to check all of that. Can you show us the output of the following commands:

$ ls /opt

$ ls /usr/local

$ echo $PATH

I have just noticed that there may be a slight omission in my instructions: That symbolic link command "ln -s /opt...." needs root permissions to execute so really I should have written the following in my instructions:

$ sudo ln -s /opt/qt5 /usr/local/qt5
Memory in C++ is a leaky abstraction .

sachusanal
Posts: 29
Joined: Thu Jun 25, 2015 10:51 am

Re: QT application running reg

Wed Jul 15, 2015 6:24 am

pi@raspberrypi ~ $ ls /opt/
minecraft-pi qt5 sonic-pi vc Wolfram
pi@raspberrypi ~ $ ls /usr/local/
bin etc games include lib man qt5 sbin share src
pi@raspberrypi ~ $ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/u sr/games
pi@raspberrypi ~ $ ls -al /opt/
total 28
drwxr-xr-x 7 root root 4096 Jul 14 11:29 .
drwxr-xr-x 22 root root 4096 May 6 22:19 ..
drwxr-xr-x 4 root root 4096 May 6 23:23 minecraft-pi
drwxr-xr-x 11 pi pi 4096 Jul 14 11:30 qt5
drwxr-xr-x 5 root root 4096 May 6 23:18 sonic-pi
drwxr-xr-x 7 root root 4096 May 6 22:37 vc
drwxr-xr-x 3 root root 4096 May 6 23:24 Wolfram
pi@raspberrypi ~ $ ls -al /usr/local/qt5
lrwxrwxrwx 1 root staff 8 Jul 14 11:30 /usr/local/qt5 -> /opt/qt5
pi@raspberrypi ~ $ cd /home/pi/
.cache/ .gconf/ .local/ squeak/
.config/ .gstreamer-0.10/ .netsurf/ .squeak/
.dbus/ .gvfs/ python_games/ .themes/
Desktop/ .idlerc/ Qt_Canvas_drawing/ .thumbnails/
pi@raspberrypi ~ $ cd /home/pi/Qt_Canvas_drawing/
pi@raspberrypi ~/Qt_Canvas_drawing $ ls
main.cpp Qt_Canvas_drawing80.png qtquick2applicationviewer
qml Qt_Canvas_drawing.pro
Qt_Canvas_drawing64.png Qt_Canvas_drawing.pro.user
pi@raspberrypi ~/Qt_Canvas_drawing $

sachusanal
Posts: 29
Joined: Thu Jun 25, 2015 10:51 am

Re: QT application running reg

Wed Jul 15, 2015 6:28 am

Hai Qt Canvas draing folder is my Qt application.
could u please help me to solve this issue.

or other wise please help
https://twolife.be/raspbian/ how can follow this link.
i didnt understand this link , what i need to download. i am using Debian wheezy which package i need to install by follwing above link

please help me to solve this issue

Heater
Posts: 16338
Joined: Tue Jul 17, 2012 3:02 pm

Re: QT application running reg

Wed Jul 15, 2015 6:39 am

sachusanal,

You have problems with your PATH environment variable:

"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/u sr/games"

Notice that space in the "/u sr/games" part? Also there is no "/opt/qt5/bin" in there, perhaps because that space causes the export PATH command to fail.

Did you set that PATH manually or is there such a space in a .bashrc file that sets the PATH for you or something?

Suggest you fix that first.

export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/opt/qt5
Memory in C++ is a leaky abstraction .

sachusanal
Posts: 29
Joined: Thu Jun 25, 2015 10:51 am

Re: QT application running reg

Wed Jul 15, 2015 6:53 am

I added the following to following to /etc/profile

$ export PATH=${PATH}:/usr/local/qt5/bin
$ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/qt5/lib
$ export QT_PLUGIN_PATH=/usr/local/qt5/plugins

I here by attach profile.
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
export PATH=${PATH}:/usr/local/qt5/bin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/qt5/lib
export QT_PLUGIN_PATH=/usr/local/qt5/plugins
if [ "`id -u`" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games"
fi
export PATH

if [ "$PS1" ]; then
if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
# The file bash.bashrc already sets the default PS1.
# PS1='\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi

# The default umask is now handled by pam_umask.
# See pam_umask(8) and /etc/login.defs.

if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi


please help me to solve this issue

Heater
Posts: 16338
Joined: Tue Jul 17, 2012 3:02 pm

Re: QT application running reg

Wed Jul 15, 2015 7:05 am

You need to ensure that /usr/local/qt5/bin is included in your PATH.

Sorry I made a mistake in my last suggestion.

Please do this:

1) Open a new terminal window.

2) Run the command:

$ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/usr/local/qt5/bin

Note that this is not the same as my last advice. I made a mistake. Also note that it is not "export PATH=$PATH:...." I want to be sure it comes out correctly with no spaces in it.

3) Now you should be able to run qmake

$ qmake




By the way, those packages from twolife are for Raspbian not Debian. I have no idea if they will install nicely and run on Debian. I really don't like adding package repositories to my operating system like that as it has cause me problems with messed up and unrecoverable package systems in the past.
Memory in C++ is a leaky abstraction .

sachusanal
Posts: 29
Joined: Thu Jun 25, 2015 10:51 am

Re: QT application running reg

Wed Jul 15, 2015 7:16 am

I export path it workingthe application is build but i get an error what i do
pi@raspberrypi ~/Qt_Canvas_drawing $ ./Qt_Canvas_drawing
EGLFS: Unable to query physical screen size, defaulting to 100 dpi.
EGLFS: To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).

Heater
Posts: 16338
Joined: Tue Jul 17, 2012 3:02 pm

Re: QT application running reg

Wed Jul 15, 2015 7:28 am

Great stuff.

Did your program build without any warnings?

Did you run your program as follows:

$ ./Qt_Canvas_drawing -platform eglfs

or

$ ./Qt_Canvas_drawing -platform xcb

You can try:

export QT_QPA_EGLFS_PHYSICAL_WIDTH=x
export QT_QPA_EGLFS_PHYSICAL_HEIGHT=y

where "x" and "y" are the physical width of your screen in millimeters.

Then run it again.
Memory in C++ is a leaky abstraction .

sachusanal
Posts: 29
Joined: Thu Jun 25, 2015 10:51 am

Re: QT application running reg

Wed Jul 15, 2015 7:43 am

hai ,
my application build without any issue but when i running i get like this no application is running

pi@raspberrypi ~/Qt_Canvas_drawing $ ./Qt_Canvas_drawing -platform eglfs
EGLFS: Unable to query physical screen size, defaulting to 100 dpi.
EGLFS: To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).

I tried out export QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT
pi@raspberrypi ~/Qt_Canvas_drawing $ export QT_QPA_EGLFS_PHYSICAL_HEIGHT=y
pi@raspberrypi ~/Qt_Canvas_drawing $
pi@raspberrypi ~/Qt_Canvas_drawing $ export QT_QPA_EGLFS_PHYSICAL_WIDTH=x
pi@raspberrypi ~/Qt_Canvas_drawing $ ./Qt_Canvas_drawing -platform eglfs EGLFS: Unable to query physical screen size, defaulting to 100 dpi.
EGLFS: To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).

what i do please help me to solve this issue

sachusanal
Posts: 29
Joined: Thu Jun 25, 2015 10:51 am

Re: QT application running reg

Wed Jul 15, 2015 7:49 am

please find my screen shot of qmake and make process
but there is no error once qmake and make please help me the above post mentioned issue

pi@raspberrypi ~/Qt_Canvas_drawing $ qmake
pi@raspberrypi ~/Qt_Canvas_drawing $ make
/usr/bin/g++ -Wl,-rpath-link,/opt/vc/lib -Wl,-rpath-link,/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/lib/arm-linux-gnueabihf -Wl,-O1 -Wl,-rpath,/usr/local/qt5/lib -o Qt_Canvas_drawing main.o qtquick2applicationviewer.o moc_qtquick2applicationviewer.o -L/opt/vc/lib -L/usr/local/qt5/lib -lQt5Quick -lQt5Qml -lQt5Network -lQt5Gui -lQt5Core -lGLESv2 -lpthread
pi@raspberrypi ~/Qt_Canvas_drawing $
pi@raspberrypi ~/Qt_Canvas_drawing $
pi@raspberrypi ~/Qt_Canvas_drawing $ ls
main.cpp Qt_Canvas_drawing64.png
main.o Qt_Canvas_drawing80.png
Makefile Qt_Canvas_drawing.pro
moc_qtquick2applicationviewer.cpp Qt_Canvas_drawing.pro.user
moc_qtquick2applicationviewer.o qtquick2applicationviewer
qml qtquick2applicationviewer.o
Qt_Canvas_drawing

Heater
Posts: 16338
Joined: Tue Jul 17, 2012 3:02 pm

Re: QT application running reg

Wed Jul 15, 2015 7:57 am

I did not say it clearly enough. I did not mean you use "x" and "y" in those export commands. They are to be replaced with whatever your screen width and height are in millimeters. Actual numbers.

Now, I thought those messages were just warnings, as it says it is defaulting to 100dpi which should be OK in many cases.

What happens after those messages? Does it just return you to the command prompt? Or does it show a blank window? Or hang up or what?

A few people have installed that Qt5 package and manage to run their programs on Raspbian so I wonder if this problem is something to do with you using Debian instead. Perhaps installing Raspbian is a way to go.
Memory in C++ is a leaky abstraction .

sachusanal
Posts: 29
Joined: Thu Jun 25, 2015 10:51 am

Re: QT application running reg

Wed Jul 15, 2015 8:15 am

pi@raspberrypi ~/Qt_Canvas_drawing $ export QT_QPA_EGLFS_PHYSICAL_HEIGHT=100
pi@raspberrypi ~/Qt_Canvas_drawing $ export QT_QPA_EGLFS_PHYSICAL_WIDTH=100
pi@raspberrypi ~/Qt_Canvas_drawing $ export QT_QPA_EGLFS_DEPTH=50
pi@raspberrypi ~/Qt_Canvas_drawing $ ./Qt_Canvas_drawing -platform xcb
This application failed to start because it could not find or load the Qt platform plugin "xcb".

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen.

Reinstalling the application may fix this problem.
Aborted
pi@raspberrypi ~/Qt_Canvas_drawing $ ./Qt_Canvas_drawing -platform eglfs


after that it is hang up nothing be shown...
no screen is shown or not to back the terminal.
please help me to solve this issue

Heater
Posts: 16338
Joined: Tue Jul 17, 2012 3:02 pm

Re: QT application running reg

Wed Jul 15, 2015 8:52 am

sachusanal,

Hmm...I'm not sure what has happened to xcb. Sadly I don't have a Pi available just now to test that.

Looking over my instructions at [url]http:/the.linuxd.org[/url] I see that I have said "Do check your memory split. Qt will need 64MB or so to give it some room. "

Perhaps that is actually necessary.

You can set the memory split using raspi-config in Raspian I have no idea how it is done in Debian. There are instructions for setting the memory split manually here: http://raspberrypi.stackexchange.com/qu ... -ram-split

Mind you the 64MB I suggest in the instructions should be the default anyway. You can check this:

$ vcgencmd get_mem arm && vcgencmd get_mem gpu

will tell you the memory split between the CPU and GPU.
Last edited by Heater on Wed Jul 15, 2015 9:21 am, edited 1 time in total.
Memory in C++ is a leaky abstraction .

sachusanal
Posts: 29
Joined: Thu Jun 25, 2015 10:51 am

Re: QT application running reg

Wed Jul 15, 2015 9:14 am

please help me to solve this issue.

pi@raspberrypi ~ $ vcgencmd get_mem arm && vcgencmd get_mem gpu
arm=880M
gpu=128M

Return to “General discussion”