December 09, 2019, 12:37:04 am


Have you visited the Allwinner Chipset wiki? -

Qt5 build for cubieboard

Started by wickwire, March 09, 2013, 04:06:39 pm

Previous topic - Next topic



I think I found the references you were mentioning before:

            (context->display(), context->config(), 0,0);


I have several definitions for this element in sub-folders, specifically in eglfs - so I could alter the definition in qtbase/src/plugins/platforms/eglfs/qeglfswindow.cpp for example...

Also, I noticed that the mkspecs/devices/linux-rasp-pi-g++ profile includes a qeglfshooks.cpp file which also has a definition for this eglCreateWindowSurface... and a bunch of other stuff as well.

Anyways, as soon as I can, I will attempt to change the values for the platforms/eglfs and see if there are any changes!


Hi wickwire,

I'm facing the same issue as you with the eglfs platform. Did you try the changes you mentioned?

If so, I'm interested in the results.




September 27, 2013, 06:15:47 am #18 Last Edit: September 27, 2013, 08:05:36 am by pcklee123
You might need to link to X11 libs to avoid the linker errors  when compiling lima
in lima/limare/tests
add -lX11 to Makefile.egl , Makefile.gles1
also add -lm to Makefile.test


Hi, eventually I managed to be successful with Qt5 on Cubieboard in the following scenarios:

Linaro Linux > as described on this linux-sunxi wiki page (many thanks to ssvb)

- worked with native Qt5 build on Cubieboard (took several hours), several cross-compile attempts made which didn't work
- using native X11 mali drivers

Linaro Linux, using the libhybris libraries

Using the stock Android in the NAND and going with Qt5 for Android

All of these worked nicely! As I have both Cubieboards A10 and A20, I think I was messing with the Linaro approaches on the A10 and Qt5 for Android on A20.


October 02, 2013, 02:29:19 am #20 Last Edit: October 02, 2013, 03:07:03 am by derekdhaas
Hi WickWire

Out of curiosity, how did you managed to compile it? Can you explain it a little.

Using the instructions of ssvb, I did not managed to get past the "OpenGL ES 2.0" test, it fails.
The OpenGL ES 2.0 functionality test failed!
You might need to modify the include and library search paths by editing

Driver is working and I can see the colored triangle

The only lib I can find is the libGLES located in:
(which I added to qmake.conf)

p.s. Cubieboard 2

More details
g++ -c -pipe -O2 -Wall -W -fPIE  -I../../../mkspecs/linux-g++ -I. -o opengles2.o opengles2.cpp
opengles2.cpp:45:25: fatal error: GLES2/gl2.h: No such file or directory

I don't have the GLES2 anywhere, and out of the first 5 pages of google I can't figure out where to get it. Using Cubian (debian distro)


As far as I recall, I believe that ssvb's tutorial worked only for the A10 for me, not the A20:

A10 + Linaro + native X11 drivers.

A20 wen't OK with Qt5 for Android, using the android JB on the NAND and the Qt5 for Android binary installer on a Linux Mint Laptop.

In any case, make sure you installed the native mali libs for X11 and not framebuffer - do you get the triangle working on Cubian's X environment?


October 03, 2013, 08:19:08 am #22 Last Edit: October 03, 2013, 08:39:57 am by derekdhaas
Yes the triangle is working, but I'm stuck at configure (not even made it to "make"... very frustrating ;))

I'm missing the header files for GLES, like stated in the verbose log of the ./configure:

"fatal error: GLES2/gl2.h: No such file or directory"

so I was wondering where did you get it :) how did you linked it... I was searching all around Google, but couldn't find any real explanation. It doesn't seem to listen to the changes in directories (I've pointed QMAKE_INCDIR_OPENGL_ES2 to a dir with GLES2/gl2.h, but the error still occures).

Since you compiled it without changing a single line, I was curious how you linked the stuff to the right directories.

The goal by the way is to compile QTwebkit to get a hardware accelerated browser (like done on the raspberry pi). Midori etc. still fall back to software rendering.


I believe this issue is not relevant in terms of A10 vs A20, but on my A10 Cubie I have:


My sugestion would be to install mlocate, index the search DB and search for gl2.h on your system.

sudo apt-get update && sudo apt-get install mlocate && sudo updatedb && sudo locate gl2.h

If anything, the headers you're missing and Qt is complaining about should be available from the sunxi-mali sources, possibly it's just a matter of making them available to Qt (some PATH or something)


Tnx WickWire, Cubian didn't include the header files, I couldn't find where the gl2.h file came from, but it's from the sunxi-mali driver (tnx for pointing that out).

So I compiled all the drivers from source, and now the .configure is working.

Hoping to get it all to compile! I will set up a better tutorial, since the other one is great but limited ;)


October 04, 2013, 05:36:42 am #25 Last Edit: October 07, 2013, 01:52:00 am by derekdhaas
Alright, little manual for Cubian:

Updated 2013/10/05
- Updated QT to 5.1.1
- Added dependencies for QTWebkit

Updated 2013/10/06
- Use g++ 4.7 (gcc/g++ 4.6 will fail compiling: RenderingAllInOne.cpp)

- Use a 4gb card at least! The build directory will become around 2 gig after building.

Lets start
Quick and dirty:
sudo -i

Install dependencies:
apt-get install build-essential autoconf automake make libtool  libdbus-1-dev libdbus-glib-1-dev flex bison gperf libicu-dev libxslt-dev ruby xorg-dev xutils-dev pkg-config libdrm-dev

Update to gcc/g++ 4.7
aptitude install install gcc-4.7 g++-4.7

Setup alternatives
update-alternatives --remove-all gcc
update-alternatives --remove-all g++

update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.7

Set gcc to use version 4.7 (option 2)
update-alternatives --config gcc

Install libdri2 and sunxi-mali
Go to /root
cd /root

Get libdri2 and sunxi-mali:
git clone
git clone

Compile libdri2:
cd libdri2
./ --prefix=/usr
make install

Go back to root:
cd /root

Compile sunxi-mali:
cd sunxi-mali
git submodule init
git submodule update
make config ABI=armhf VERSION=r3p0
make install

Install QT5 from source
Back to root:
cd /root

Get QT5:
tar -xzf qt-everywhere-opensource-src-5.1.1.tar.gz
Go to directory:
cd qt-everywhere-opensource-src-5.1.1

Configure it: (this will successfully configure QT5 with opengl) It doesn't meet all the recommended requirements (gstreamer, GTK theme, libudev) if you know how to get how to get all the recommendations working, feel free to post it
./configure -release -opensource -confirm-license -opengl es2 -no-eglfs -no-linuxfb -no-pch -qt-xcb

Make: (Will take a very long time)
make -j 2

Make install:
make install



Thanks for sharing!

Talking to ssvb yesterday, I got some additional pointers regarding A20 performance and X11 mali libs:

instead of using r3p0, we are encouraged to go with r3p2 for better performance on A20 over A10 (cubieboard1). As I have it, r3p0 on Cubieboard 2 won't harness the SoC's full potential.

However, r3p2 requires proper kernel support, so it might be that Cubian's stock images aren't directed at this and the same even for  the master branch on github for the sunxi kernel, and so one will have to step back even further to get this working on top performance:

1) Building a kernel from ssvb's github branch (which includes the proper patches) hooking it to an ARM linux rootfs and finishing with a custom SD Card image
2) After successful boot, proceed with X11 mali binaries (but installing r3p2 instead of r3p0) and attempt Qt5 build

I will attempt to do this during the weekend and in the end, compare performance results between A10 and A20 and post any additional steps that may be required over what we already have.


October 05, 2013, 03:42:05 am #27 Last Edit: October 05, 2013, 06:36:12 am by derekdhaas
My next goal is to compile mlbrowser (a browser build on QT5 & QTWebkit, fully hardware accelerated browser): which needs:
- QTWebkit (to compile)
- QT5 (compiled in previous example)

Run before starting:
sudo -i
cd /root

Compile QT5Webkit

First we need the prerequirements:
aptitude install flex bison gperf libicu-dev libxslt-dev ruby

Didn't install libicu before compiling QT5? Use this step:
Go to the qt-every* folder
cd qt-every*

ICU is required to be build in QTBase before compiling QTWebkit, so we have to compile a small portion of QTBase again:

cd qtbase/src/plugins/platforms/xcb
make install

Compile QTWebkit
Only needed when not installed at first compile
Set the env variables:
export QTDIR=/usr/local/Qt-5.1.1
export PATH=$QTDIR/bin:$PATH./

And BUILD: (takes an hour or so)
qtwebkit/Tools/Scripts/build-webkit --qt --debug

Compile mlbrowser
Go to /root
cd /root

Download mlbrowser from source:
git clone
cd mlbrowser

mkdir build
cd build

replace the line starting with "LIBS" in the Makefile with this line:
LIBS = $(SUBLIBS) -L/opt/vc/lib -lQt5WebKitWidgets -pthread -lrt -L/usr/lib/arm-linux-gnueabihf -lQt5Sql -lQt5Quick -lQt5OpenGL -lQt5PrintSupport -lQt5WebKit -lQt5Qml -lQt5Widgets -lQt5Network -lQt5Gui -lQt5Core -lGLESv2 -lpthread

make install

Test it:
mlbrowser -platform eglfs

P.s. I'm still compiling and will edit this tutorial along the way.

Used sources:

For those who hate "sudo -i", just append sudo in front of every line except cd and mkdir and use your cubie homedir


Stuck with a few errors:
/home/cubie/qt-everywhere-opensource-src-5.1.1/qtwebkit/Source/WebCore//.obj/release-shared/dom/DOMAllInOne.o: In function `WebCore::TreeScope::findAnchor(WTF::String const&)':
DOMAllInOne.cpp:(.text._ZN7WebCore9TreeScope10findAnchorERKN3WTF6StringE+0xa2): undefined reference to `WebCore::HTMLAnchorElement::name() const'
DOMAllInOne.cpp:(.text._ZN7WebCore9TreeScope10findAnchorERKN3WTF6StringE+0xb8): undefined reference to `WebCore::HTMLAnchorElement::name() const'
/home/cubie/qt-everywhere-opensource-src-5.1.1/qtwebkit/Source/WebCore//.obj/release-shared/dom/DOMAllInOne.o: In function `WebCore::Document::~Document()':
DOMAllInOne.cpp:(.text._ZN7WebCore8DocumentD2Ev+0x382): undefined reference to `WebCore::SVGDocumentExtensions::~SVGDocumentExtensions()'
/home/cubie/qt-everywhere-opensource-src-5.1.1/qtwebkit/Source/WebCore//.obj/release-shared/dom/DOMAllInOne.o: In function `WebCore::Document::implicitClose()':
DOMAllInOne.cpp:(.text._ZN7WebCore8Document13implicitCloseEv+0x94): undefined reference to `WebCore::HTMLLinkElement::dispatchPendingLoadEvents()'
DOMAllInOne.cpp:(.text._ZN7WebCore8Document13implicitCloseEv+0x98): undefined reference to `WebCore::HTMLStyleElement::dispatchPendingLoadEvents()'
DOMAllInOne.cpp:(.text._ZN7WebCore8Document13implicitCloseEv+0xa8): undefined reference to `WebCore::SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements()'
DOMAllInOne.cpp:(.text._ZN7WebCore8Document13implicitCloseEv+0x17e): undefined reference to `WebCore::SVGDocumentExtensions::startAnimations()'
/home/cubie/qt-everywhere-opensource-src-5.1.1/qtwebkit/Source/WebCore//.obj/release-shared/dom/DOMAllInOne.o: In function `WebCore::Document::setTitle(WTF::String const&)':
DOMAllInOne.cpp:(.text._ZN7WebCore8Document8setTitleERKN3WTF6StringE+0x96): undefined reference to `WebCore::HTMLTitleElement::setText(WTF::String const&)'

Haven't got any clue how to fix this.



Compiling sunxi-mali using:

cd /home/sunxi-mali
git submodule init
git submodule update
make config ABI=armhf VERSION=r3p2-01rel1
make install

Will work correctly, but it's missing:
sunxi_mali_ump_dri2.h:27:21: fatal error: ump/ump.h:

when compiling for example the xf86-video-fbturbo. when changing it back to r3p0 all will compile.