bandi84
Posts: 4
Joined: Sat Feb 23, 2013 10:59 am

Re: Qt5 raspbian - errors, errors and more errors :(

Sat Feb 23, 2013 11:18 am

Ok, literraly nothing works for me...

I tried every tutorial available, ran into some error with each one...
Is it possible to install QT creator on the PI, and compile my QT pro files I've created on my desktop?
I dont't care if it is slow, as long as it is working...
I gave up trying to build the cross compiler, spent too much time looking up errors and trying different tutorials.... Time I could have spent developing my QT app for the Pi...

It would be really nice to have a VM linux image with the QT5 SDK (Creator, etc), cross compiler, etc.. that WORKS along with a raspbian image that also WORKS... This way it would work for any desktop running the said VM environment..

Andy

User avatar
topguy
Posts: 5624
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Qt5 raspbian - errors, errors and more errors :(

Mon Feb 25, 2013 1:55 pm

bandi84 wrote:Ok, literraly nothing works for me...

I tried every tutorial available, ran into some error with each one...
Is it possible to install QT creator on the PI, and compile my QT pro files I've created on my desktop?
I dont't care if it is slow, as long as it is working...
I gave up trying to build the cross compiler, spent too much time looking up errors and trying different tutorials.... Time I could have spent developing my QT app for the Pi...

Andy
You dont really need QtCreator installe on the PI to compile your projects. If you have the .pro file, you should only need "qmake" and make+compiler to compile.

I use the pre-compiled packages from http://twolife.be/raspbian which works quite nice. He also have the packages that contains "qmake" ( libqt5-dev-bin) and "qmlscene" (libqt5-declarative-bin).

bandi84
Posts: 4
Joined: Sat Feb 23, 2013 10:59 am

Re: Qt5 raspbian - errors, errors and more errors :(

Mon Feb 25, 2013 5:38 pm

thanks for the help! Are you referring to the http://twolife.be/raspbian/pool/main/qt5/ directories?
I tried to install the base package (libqt5-dev-bin_5.0.1-0rpi2_armhf.deb) uding dpkg, but several dependecy issues came up, and some of them could not be installed, so basically the installation failed.
Did you install any other packages on raspbian before these? There are a lot of .deb and tar files in here, is there a particular order for them to be installed in?

User avatar
topguy
Posts: 5624
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Qt5 raspbian - errors, errors and more errors :(

Tue Feb 26, 2013 3:04 pm

bandi84 wrote:thanks for the help! Are you referring to the http://twolife.be/raspbian/pool/main/qt5/ directories?
I tried to install the base package (libqt5-dev-bin_5.0.1-0rpi2_armhf.deb) uding dpkg, but several dependecy issues came up, and some of them could not be installed, so basically the installation failed.
Did you install any other packages on raspbian before these? There are a lot of .deb and tar files in here, is there a particular order for them to be installed in?
I meant that you should add twolife.be as a package repository.
(until very recently there was instructions on that page just for doing this).

What you need to do is to add the following line to "/etc/apt/sources.list"

Code: Select all

deb http://twolife.be/raspbian/ wheezy main
Then you do a "sudo apt-get update" and "sudo apt-get upgrade".

After that you can do "sudo apt-get install libqt5" etc.

PS:
If you have installed packages manually with dpkg, I would suggest that you uninstall them first before installing with apt.

bandi84
Posts: 4
Joined: Sat Feb 23, 2013 10:59 am

Re: Qt5 raspbian - errors, errors and more errors :(

Wed Feb 27, 2013 12:59 pm

topguy wrote:
bandi84 wrote:thanks for the help! Are you referring to the http://twolife.be/raspbian/pool/main/qt5/ directories?
I tried to install the base package (libqt5-dev-bin_5.0.1-0rpi2_armhf.deb) uding dpkg, but several dependecy issues came up, and some of them could not be installed, so basically the installation failed.
Did you install any other packages on raspbian before these? There are a lot of .deb and tar files in here, is there a particular order for them to be installed in?
I meant that you should add twolife.be as a package repository.
(until very recently there was instructions on that page just for doing this).

What you need to do is to add the following line to "/etc/apt/sources.list"

Code: Select all

deb http://twolife.be/raspbian/ wheezy main
Then you do a "sudo apt-get update" and "sudo apt-get upgrade".

After that you can do "sudo apt-get install libqt5" etc.

PS:
If you have installed packages manually with dpkg, I would suggest that you uninstall them first before installing with apt.


It's working, thanks a LOT for your help, much appreciated :D I was able to make and run a few QT creator example projects succesfully on the PI :)

bandi84
Posts: 4
Joined: Sat Feb 23, 2013 10:59 am

Re: Qt5 raspbian - errors, errors and more errors :(

Thu Feb 28, 2013 3:56 pm

bandi84 wrote:
topguy wrote:
bandi84 wrote:thanks for the help! Are you referring to the http://twolife.be/raspbian/pool/main/qt5/ directories?
I tried to install the base package (libqt5-dev-bin_5.0.1-0rpi2_armhf.deb) uding dpkg, but several dependecy issues came up, and some of them could not be installed, so basically the installation failed.
Did you install any other packages on raspbian before these? There are a lot of .deb and tar files in here, is there a particular order for them to be installed in?
I meant that you should add twolife.be as a package repository.
(until very recently there was instructions on that page just for doing this).

What you need to do is to add the following line to "/etc/apt/sources.list"

Code: Select all

deb http://twolife.be/raspbian/ wheezy main
Then you do a "sudo apt-get update" and "sudo apt-get upgrade".

After that you can do "sudo apt-get install libqt5" etc.

PS:
If you have installed packages manually with dpkg, I would suggest that you uninstall them first before installing with apt.


It's working, thanks a LOT for your help, much appreciated :D I was able to make and run a few QT creator example projects succesfully on the PI :)

Ok, still not working perfectly, i get tis message on a few QT Creator example projects:

Code: Select all

Project ERROR: Unknown moudule(s) in QT: declarative
which is interesting, since I installed all the packages from the qtdeclerative directory...
Any ideas?

User avatar
topguy
Posts: 5624
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Qt5 raspbian - errors, errors and more errors :(

Fri Mar 01, 2013 9:27 am

bandi84 wrote:[
Ok, still not working perfectly, i get tis message on a few QT Creator example projects:

Code: Select all

Project ERROR: Unknown moudule(s) in QT: declarative
which is interesting, since I installed all the packages from the qtdeclerative directory...
Any ideas?
I would recheck with a run of "sudo apt-get install libqt5-declarative-dev" in any case.

but... I think the problem is that these libraries don't support QtQuick1, and you are probably trying a Qt4 app.
In the .pro file, I think you can try to replace "declarative" with "quick", but you also would have to change includes and function calls to get it to work most likely.
(could be a good exercise)

sunilvb
Posts: 4
Joined: Sun Feb 02, 2014 2:54 am

Re: Qt5 raspbian - errors, errors and more errors :(

Sun Feb 02, 2014 3:03 am

Hi,

I am trying to install Qt5 on my RPi...
I have made the entry in "/etc/apt/sources.list" as described in this thread.
Then I did a "sudo apt-get update" and "sudo apt-get upgrade" as described in this thread.
After that I did "sudo apt-get install libqt5" and I am getting an error "E: unable to locate package libqt5"
Please help !!

thanks in advance.

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

Re: Qt5 raspbian - errors, errors and more errors :(

Fri Feb 07, 2014 10:31 am

I don't think there is a Qt5 package for Debian Wheezy or Raspbian.

I have build Qt5.2 from source code using the instructions here:

http://qt-project.org/wiki/Native_Build ... spberry_Pi

I made some notes about how I tackled the process here: http://a.linuxsecured.net/qt-5-2-for-raspberry-pi/

You can down load a package containing the resulting QT5.2 binaries and libraries from my DropBox account here:

https://dl.dropboxusercontent.com/u/812 ... .2-rpi.tgz

This even supports opengl into the frame buffer. No X Windows required!

I have not built Qt Creator for the Pi. I think it's better to develop code on the PC and then just rebuild it on the Pi when it works nicely. All you need is:

Code: Select all

$ qmake
$ make
Also I think the Qt4 version of QtCreator can be used with the Qt5 libs quite happily if you really want to.


Aros
Posts: 32
Joined: Tue Apr 28, 2015 9:08 am

Re: Qt5 raspbian - errors, errors and more errors :(

Sat May 16, 2015 1:12 pm

Hi heater,
I have downloaded your binaries. When i try to launch the qmlscene executable on my RPi, i get the following error:

Code: Select all

./qmlscene: error while loading shared libraries: libQt5Quick.so.5: cannot open shared object file: No such file or directory
Any idea what's wrong? I am a complete and utter Linux newbie so this might be something trivial.

Thanks a lot.

User avatar
topguy
Posts: 5624
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Qt5 raspbian - errors, errors and more errors :(

Sat May 16, 2015 2:16 pm

If Heater's package only contains the libraries itself and no install script you might need to tell the "dynamic linker" (ld) how to find those libraries.

For example:
If the Qt libraries is located in "/opt/Qt5.2/lib" you can either run

Code: Select all

export LD_LIBRARY_PATH="/opt/Qt5.2/lib"
or you can add "/opt/Qt5.2/lib" to the config file for ld, "/etc/ld.so.conf" and then run the command "sudo ldconfig" to update the dynamic linker.

You can also test any binary file with "ldd" to check if its needed libraries are found.

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

Re: Qt5 raspbian - errors, errors and more errors :(

Sat May 16, 2015 5:30 pm

I have some instructions for using that package here: http://the.linuxd.org/qt-5-2-for-raspberry-pi/ See the part about setting environment variables.

Aros
Posts: 32
Joined: Tue Apr 28, 2015 9:08 am

Re: Qt5 raspbian - errors, errors and more errors :(

Mon May 18, 2015 5:54 pm

Thanks Heater, I followed the instructions you posted and it seems it did the trick. At least the qmlscene binary now performs as expected. As for the cube demo - it is not part of your package and it is pretty difficult to get the version of the demo as it was in 5.2 because the current version is 5.4. Trying to compile the 5.4 version of the demo I get the following output:

Code: Select all

[email protected] ~/dev/cube $ make
/usr/bin/g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard -O2 -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/opt/qt5/mkspecs/devices/linux-rasp-pi-g++ -I. -I/opt/qt5/include -I/opt/qt5/include/QtWidgets -I/opt/qt5/include/QtGui -I/opt/qt5/include/QtCore -I. -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -o main.o main.cpp
In file included from main.cpp:46:0:
mainwidget.h:46:25: fatal error: QOpenGLWidget: No such file or directory
 #include <QOpenGLWidget>
                         ^
compilation terminated.
Makefile:731: recipe for target 'main.o' failed
make: *** [main.o] Error 1
Well, I take it, that it has been upgraded since 5.2 to use some file QOpenGLWidget, that was not present in 5.2.

By any chance do you have 5.4 version built on your Pi as well?

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

Re: Qt5 raspbian - errors, errors and more errors :(

Tue May 19, 2015 1:03 am

Sadly I have not had time to get a recent Qt5 build done.

Can you try:

$ cd wherever/the/cube/demo/is
$ /usr/local/qt5/bin/qmake
$ make


Or there are some clues here: https://forum.qt.io/topic/14081/qglwidget-error/2

Aros
Posts: 32
Joined: Tue Apr 28, 2015 9:08 am

Re: Qt5 raspbian - errors, errors and more errors :(

Tue May 19, 2015 2:10 pm

$ cd wherever/the/cube/demo/is
That's the point. Examples are not part of your build (at least I searched all the folders and didn't find any) and I was just not able to get the demo from 5.2. It is nowhere to be found and I would have to install the 5.2 version on some linux PC to get it and copy it from there. But I have no Linux PC apart from the Raspberry and there's no space left on the memory card. Maybe if you could send me the zipped demo if you have it...
$ /usr/local/qt5/bin/qmake
Yes, I figured that I need to use the absolute path or else it collides with the default QT4.8 version installed on Raspbian. But still the result with the cube demo from 5.4 is as posted above.

Anyway thanks a lot. I will share my experience when I try to build my own project with your 5.2 build.

Aros
Posts: 32
Joined: Tue Apr 28, 2015 9:08 am

Re: Qt5 raspbian - errors, errors and more errors :(

Thu Nov 17, 2016 12:50 am

OK, it may be a bit naive to resurrect the thread after such a long time but still, I am at my wits end again...

I have just spent 2 whole days (I mean full days, nearly 48 hours - you should see how I look) trying to compile QT again. Or get it from jessie repository or from famous twolife's site :https://twolife.be/raspbian/.

Well, nothing works. Again.

Basically here's my problem. I need to run my QT application on Raspi but without X because it needs to use OpenGL ES 2.0 and I believe that X does not support ES.

Back then in 2015 I think I solved the problem by using Heater's binaries that are linked somewhere in this thread. It worked till this point, but now I came across some QT bug that I really cannot come over. During the time I developed the application, whenever I found some QT bug, and there were many of them, I always (after many hours) came up with some workaround. Damn, I would have done anything in order not to have to go through the martyr of trying to compile QT...

But this bug... has changed that all. And so I started all over again. And after those 48 hours, I am back here, where it all began. And basically I hope that some here has some newer QT binaries for raspberry. I need QT5.4 or newer if I understand it correctly.

Heater, if there's any hope you see this... Do you by chance have any newer build of QT for raspi? The thing is that I need exactly what you have provided me back than with QT5.2 that is the version with OpenGL ES2 support without X. And these kind of binaries are very rare. In official Jessie package system there is currently QT5.3 which I tried (though I don't think it would solve The Bug, but hey, at least i tried...), but it seems - correct me if I'm mistaken - that this version requires X. If I execute my application which builds without any problem, I get this error:

QXcbConnection: Could not connect to display


I have also tried twolife's binaries (I don't know whether I have installed them correctly as all this messing with sources.list and all the related collisions are maybe too much for a spoiled Windows guy who expects the things to just... ehm, work). It seems his latest build is QT5.5.1. It builds as well, but I get the same error mentioned above. Therefore, again, I conclude that also these binaries require X.

Summary: Is there anyone who has QT binaries of 5.4 or higher with direct OpenGL ES support and no X?

User avatar
topguy
Posts: 5624
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Qt5 raspbian - errors, errors and more errors :(

Thu Nov 17, 2016 1:57 pm

Twolife repo seems to be up to Qt 5.5.1.

I made this script a while ago: https://github.com/Topguy/Raspberry-Qt5 ... e_setup.sh

Note especially the tricks regarding renaming "libGLESv2.so" libraries in "/opt/vc".
You must make sure ( using "ldd" command ) that your application uses the libraries in "/opt/vc" and not some the mesa-libraries that is installed by default in Jessie.
Its done by using "export LD_LIBRARY_PATH=/opt/vc/lib" and creating copies (or symlinks) with the correct names in that folder.

This way I was able to do eglfs stuff with Qt. ( https://www.youtube.com/watch?v=ID9z1iNu7OI )
There has been updates to Jessie and there have been updates to Twolife so I cant be sure if the script works out of the box anymore.

Aros
Posts: 32
Joined: Tue Apr 28, 2015 9:08 am

Re: Qt5 raspbian - errors, errors and more errors :(

Sun Nov 20, 2016 9:32 pm

OK, thanks. Sorry for the late response, I have been out of Internet connectivity for several days now. I will try your suggestions and let you know. However, as I said, I have tried Twolife's binaries but they seem to be linked to X. I will try your script then...

User avatar
topguy
Posts: 5624
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Qt5 raspbian - errors, errors and more errors :(

Sun Nov 20, 2016 10:47 pm

You have to specify that you want to use OpenGL ES either by using the option "-platform=eglfs" to your progam or set an environement variable

Code: Select all

export QT_QPA_PLATFORM=eglfs

Aros
Posts: 32
Joined: Tue Apr 28, 2015 9:08 am

Re: Qt5 raspbian - errors, errors and more errors :(

Wed Nov 23, 2016 3:28 pm

OK, thanks but as I am not a Linux Guru, I will need some more help with this.
I have tried your script but in the end I get:

Code: Select all

E: Unable to locate package qml-module-qtquick-controls
(and some more packages...)

Well I've been trying to understand what your script does and what I don't understand is this. There is this code in the script:

Code: Select all

# Add the twolife.be repository.
sudo bash -c 'cat << EOF > /etc/apt/sources.list.d/twolife.list
# Raspbian Jessie (stable)
deb https://twolife.be/raspbian/ jessie main qt
deb-src https://twolife.be/raspbian/ jessie main qt
EOF'
I suppose that this creates a file as a source for apt-get. But how does the apt-get know that it should use twolife.list? I know that by default it uses sources.list. Does it also search through everything in sources.list.d ?

Also note that my current version is wheezy. In meanwhile, I will also try the script on jessie, which I have on another sd card.

User avatar
topguy
Posts: 5624
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Qt5 raspbian - errors, errors and more errors :(

Wed Nov 23, 2016 3:40 pm

The script was made especially for Raspbian Jessie (a clean new installation of Jessie even). I would not recommend running it on Wheezy unless you understand exactly what it does and can test each step manually.

Aros
Posts: 32
Joined: Tue Apr 28, 2015 9:08 am

Re: Qt5 raspbian - errors, errors and more errors :(

Wed Nov 23, 2016 4:18 pm

But is there any reason why for example

Code: Select all

apt-get install qml-module-qtquick2
should not work? As I said it says it is unable to locate the package. I have checked and the twolife.list is in sources.list.d.

Does my version need to be jessie to use twolife's repository? I'd expect that this is not the case but then again... It does not work.

The trouble is there are numerous hours invested in the image I have and I cannot simply do a clean install. Also I don't think there is enough space for the update process to jessie. This is only 1GB sd card with minimal image...

//edit: I have tried it on fresh minibian image with jessie kernel and it looks better but I do get this:

Code: Select all

/sbin/ldconfig.real: /usr/lib/arm-linux-gnueabihf/libEGL.so.1 is not a symbolic link
I sense some connection with what you said about symbolic linking libEGL but I don't really know what's wrong.

//edit2: what I have just mentioned above happens when ldconfig command is executed. Anyway by installing the packages one by one (while clearing the apt-get cache in between) I was finally able to install it on that jessie image. I did not install the demos because there is really no more room left for them. But that shouldn't matter right? But when I run qmake on my project it says it cannot find a QT installation. I guess I need to add it to he path, right? But how do I do that? Thanks...

//edit3: OK, I am completely lost. Why doesn't your script install qt5-default package? I thought that's the main QT package...

User avatar
topguy
Posts: 5624
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Qt5 raspbian - errors, errors and more errors :(

Wed Nov 23, 2016 10:21 pm

You have to verify that the packages are actually downloaded from "twolife.be" and not using "mirrordirector.raspberrypi.org" if you are unsure if the apt config are correct.

I'not exactly sure if the message from ldconfig is an error or just a warning. But using "ldd" on you application binary after you have compiled it should tell tell you if the linker can find the correct libraries.
You should also be able to use the "ldd" command on the "qmlscene" (or "qml") binary also.
And if everything is working then you can do "qmlscene -platform eglfs" and should end up with a fullscreen filebrowser. Because qmlscene will ask you to select a qml file to run if you done specify it as a parameter.

I think that qt5-default just will override some default settings so that if you have both qt4 anf qt5 installed in your system then qt5 will be the "default" version if you run tools like "qmake" that exists on both.
I might be wrong about that, and it will not hurt if you install it (unless it starts installing packages not from twolife.be) and afterwards you probably don't need that environment variable specifying QT_VERSION.

I don't have a setup of this on any of my Pis at the moment or else I could have been more precise and not just taking it from memory.

If you want to doublecheck which packages are in the twolife repo then look into these folders: https://twolife.be/raspbian/pool/qt/
In here : https://twolife.be/raspbian/pool/qt/qtb ... ource-src/ I can see that qt5-default is part of it so it should be safe to install.

Aros
Posts: 32
Joined: Tue Apr 28, 2015 9:08 am

Re: Qt5 raspbian - errors, errors and more errors :(

Thu Nov 24, 2016 4:32 pm

Well seems I am not meant to get it working, there is always something...

After installing qt5-default, I made some progress... Now I am able to call qmake, but at this point, lrelease is missing. And to get lrelease it seems I need to install qttools5-dev-tools which is 70MB package. There is no way I can get that to install on the SD card. Maybe if I move the apt cache to USB stick but even then there is not enough space. I will have to delete some packages but I don't know what any of those are for so this may take a while... Anyway, thanks for your support, I will let you know as soon as I progress with this.

Also do you think that when it works on jessie SD card, I can somehow move it to the wheezy SD card with all of the dependencies? Do you think that might work? Thanks...

//edit: Yes, there is always something. I was finally able install qttools5-dev-tools and I ran lrelease. Now I finally wanted to build the application but suddenly I found out that both make and g++ somehow vanished from the system. Now I'd like to install them but it wants 103 MB. That's way over what I could actually remove. It is really easy to install anything but it is nearly impossible to get rid of it. Every installation fetches tons of other packages. But when you try to remove something almost no space is cleared in the end.

Return to “Raspbian”