- step by step by Beginner’s guide to cross-compile Qt5 on RaspberryPi
I got lots of problems as following,
- Fail => sudo apt-get install ia32-libs
sudo apt-get update
sudo apt-get install ia32-libs
- complier error
- make[4]: *** [.obj/release-shared/qeglfshooks_pi.o] Error 1
- make[4]: Leaving directory `/home/nathan/opt/qt5/qtbase/src/plugins/platforms/eglfs'
- make[3]: *** [sub-eglfs-make_first] Error 2
- make[3]: Leaving directory `/home/nathan/opt/qt5/qtbase/src/plugins/platforms'
- make[2]: *** [sub-platforms-make_first] Error 2
- make[2]: Leaving directory `/home/nathan/opt/qt5/qtbase/src/plugins'
- make[1]: *** [sub-plugins-make_first] Error 2
- make[1]: Leaving directory `/home/nathan/opt/qt5/qtbase/src'
- make: *** [sub-src-make_first] Error
A: http://qt-project.org/forums/viewthread/33587
Ok Solution:
type in root$ sudo find ~/opt -type f -exec grep -H ‘vc_dispmanx_element_change_attributes’ {} \;
Password: your_root_password
then it should find 2 locations
/Users/your_user_name/opt/qt5/qtbase/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp
and
/Users/your_user_name/opt/rasp-pi-rootfs/opt/vc/include/interface/vmcs_host/vc_dispmanx.h
First edit prototype of function in vc_dispmanx.h from:
VCHPRE_ int VCHPOST_ vc_dispmanx_element_change_attributes(DISPMANX_UPDATE_HANDLE_T
update, DISPMANX_ELEMENT_HANDLE_T element, uint32_t change_flags, int32_t layer, uint8_t opacity,
const VC_RECT_T *dest_rect, const VC_RECT_T *src_rect,
DISPMANX_RESOURCE_HANDLE_T mask, VC_IMAGE_TRANSFORM_T transform );
To:
VCHPRE_ int VCHPOST_ vc_dispmanx_element_change_attributes(DISPMANX_UPDATE_HANDLE_T
update, DISPMANX_ELEMENT_HANDLE_T element, uint32_t change_flags, int32_t layer, uint8_t opacity,
const VC_RECT_T *dest_rect, const VC_RECT_T *src_rect, DISPMANX_RESOURCE_HANDLE_T
mask, DISPMANX_TRANSFORM_T transform );
Then Edit
/Users/your_user_name/opt/qt5/qtbase/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp
go to function moveDispmanxLayer and make sure it looks like this:
static void moveDispmanxLayer(EGLNativeWindowType window, const QPoint &pos)
{
EGL_DISPMANX_WINDOW_T *eglWindow = static_cast<EGL_DISPMANX_WINDOW_T *>(window);
QSize size(eglWindow->width, eglWindow->height);
VC_RECT_T dst_rect;
dst_rect.x = pos.x();
dst_rect.y = pos.y();
dst_rect.width = size.width();
dst_rect.height = size.height();
VC_RECT_T src_rect;
src_rect.x = 0;
src_rect.y = 0;
src_rect.width = size.width() << 16;
src_rect.height = size.height() << 16;
DISPMANX_UPDATE_HANDLE_T dispman_update = vc_dispmanx_update_start(0);
vc_dispmanx_element_change_attributes(dispman_update,
eglWindow->element,
ELEMENT_CHANGE_DEST_RECT /*change_flags*/,
0,
0,
&dst_rect, NULL,
0,
(DISPMANX_TRANSFORM_T)0);
vc_dispmanx_update_submit_sync(dispman_update);
}
Then recompile
- install qt5 library at pi
A: http://ricky-tee.blogspot.tw/2013/03/running-qt5-cinematic-experience.html
http://twolife.be/raspbian/
we have to modify twolife's Raspbian repository
http://twolife.be/raspbian/
deb http://twolife.be/raspbian/ wheezy main backports deb-src http://twolife.be/raspbian/ wheezy main backportssudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 2578B775
could not find xcb plugin
A:sudo apt get install libx11-xcb-dev
A: http://qt-project.org/doc/qtcreator-2.8/creator-deployment-maemo.html
But I found I can't succeed when setting as following at *.pro,
target.path = /home/pi
- bash: /home/pi/qaz: No such file or directory
A: http://qt-project.org/doc/qtcreator-2.8/creator-deployment-maemo.html
But I found I can't succeed when setting as following at *.pro,
target.path = /home/pi
INSTALLS += target
When I create another folder at /home/pi, I can deploy and run it successfully
target.path = /home/pi/test
INSTALLS += target
- “The selected build of GDB does not support Python scripting.It cannot be used in Qt Creator.”
A: sudo apt-get install gdb-multiarch
https://jeanleflambeur.wordpress.com/2014/09/28/remote-debugging-on-the-raspberry-pi-from-qtcreator/
http://sourceware.org/gdb/papers/multi-arch/whatis.html
沒有留言:
張貼留言