https://wiki.qt.io/Raspberry_Pi_Beginners_Guide
Raspberry Pi Beginners Guide - Qt Wiki
From Qt Wiki En Ar Bg De El Es Fa Fi Fr Hi Hu It Ja Kn Ko Ms Nl Pl Pt Ru Sq Th Tr Uk Zh Introduction This is a step by step guide to help beginners to cross-compile Qt5 for the Raspberry Pi. This allows you to be able to compile Qt5 applications for the Ra
wiki.qt.io
원래는 최근이미지(jessie 또는 stretch image)기준은 아래 사이트 참고했습니다..
(Following is modified for jessie or stretch rpi os image.)
- https://wiki.qt.io/RaspberryPi2EGLFS
RaspberryPi2EGLFS - Qt Wiki
A modern guide for cross-compiling Qt for HW accelerated OpenGL with eglfs on Raspbian and setting up Qt Creator Initial notes This is not intended for running desktop-style, windowed Qt apps under X11, but rather for the real embedded/device creation use
wiki.qt.io
3. raspi-config] boot to the console
[on RPi] (optional) Run raspi-config, change it to boot to the console instead of X, change the GPU memory to 256 MB. |
10. 번 수정 아래에서 5.9 로 입력함.
mango@ubuntu:~/raspi$ git clone git://code.qt.io/qt/qtbase.git -b 5.9
mango@ubuntu:~/raspi$ |
- configure
( Qt버젼을 5.9 사용했으므로 -no-use-gold-linker 추가, rpi3사용해서 device 옵션도 수정)
mango@ubuntu:~/raspi/qtbase$ mango@ubuntu:~/raspi/qtbase$ ./configure -release -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v -no-use-gold-linker = /home/mango/raspi/qtbase = /home/mango/raspi/qtbase Creating qmake... make: Nothing to be done for `first'. Command line: -release -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=/home/mango/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot /home/mango/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix /home/mango/raspi/qt5pi -hostprefix /home/mango/raspi/qt5 -v -no-use-gold-linker This is the Qt Open Source Edition. You have already accepted the terms of the Open Source license. Running configuration tests... Done running configuration tests. Configure summary: Building on: linux-g++ (i386, CPU features: ) Building for: devices/linux-rasp-pi3-g++ (arm, CPU features: neon) Configuration: cross_compile compile_examples enable_new_dtags largefile neon precompile_header shared rpath release c++11 concurrent dbus reduce_exports stl Build options: Mode ................................... release Optimize release build for size ........ no Building shared libraries .............. yes Using C++ standard ..................... C++11 Using ccache ........................... no Using gold linker ...................... no Using new DTAGS ........................ yes Using precompiled headers .............. yes Using LTCG ............................. no Target compiler supports: NEON ................................. yes Build parts ............................ libs Qt modules and options: Qt Concurrent .......................... yes Qt D-Bus ............................... yes Qt D-Bus directly linked to libdbus .... yes Qt Gui ................................. yes Qt Network ............................. yes Qt Sql ................................. yes Qt Testlib ............................. yes Qt Widgets ............................. yes Qt Xml ................................. yes Support enabled for: Using pkg-config ....................... yes QML debugging .......................... yes udev ................................... yes Using system zlib ...................... yes Qt Core: DoubleConversion ....................... yes Using system DoubleConversion ........ yes GLib ................................... yes iconv .................................. yes ICU .................................... no Logging backends: journald ............................. no syslog ............................... no slog2 ................................ no Using system PCRE2 ..................... no Qt Network: getaddrinfo() .......................... yes getifaddrs() ........................... yes IPv6 ifname ............................ yes libproxy ............................... no OpenSSL ................................ yes Qt directly linked to OpenSSL ........ no SCTP ................................... no Use system proxies ..................... yes Qt Gui: Accessibility .......................... yes FreeType ............................... yes Using system FreeType ................ yes HarfBuzz ............................... yes Using system HarfBuzz ................ yes Fontconfig ............................. yes Image formats: GIF .................................. yes ICO .................................. yes JPEG ................................. yes Using system libjpeg ............... yes PNG .................................. yes Using system libpng ................ yes EGL .................................... yes OpenVG ................................. no OpenGL: Desktop OpenGL ....................... no OpenGL ES 2.0 ........................ yes OpenGL ES 3.0 ........................ yes OpenGL ES 3.1 ........................ yes Session Management ..................... yes Features used by QPA backends: evdev .................................. yes libinput ............................... yes INTEGRITY HID .......................... no mtdev .................................. yes tslib .................................. yes xkbcommon-evdev ........................ yes QPA backends: DirectFB ............................... no EGLFS .................................. yes EGLFS details: EGLFS OpenWFD ........................ no EGLFS i.Mx6 .......................... no EGLFS i.Mx6 Wayland .................. no EGLFS RCAR ........................... no EGLFS EGLDevice ...................... no EGLFS GBM ............................ yes EGLFS Mali ........................... no EGLFS Raspberry Pi ................... yes EGL on X11 ........................... no LinuxFB ................................ yes VNC .................................... yes Mir client ............................. no X11: Using system-provided XCB libraries .. yes EGL on X11 ........................... no Xinput2 .............................. yes XCB XKB .............................. yes XLib ................................. yes XCB render ........................... yes XCB GLX .............................. yes XCB Xlib ............................. yes Using system-provided xkbcommon ...... no Qt Widgets: GTK+ ................................... no Styles ................................. Fusion Windows Qt PrintSupport: CUPS ................................... yes Qt Sql: DB2 (IBM) .............................. no InterBase .............................. no MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... yes PostgreSQL ............................. yes SQLite2 ................................ yes SQLite ................................. yes Using system provided SQLite ......... no TDS (Sybase) ........................... yes Note: Also available for Linux: linux-clang linux-icc Note: Dropped compiler flags '-pthread' when detecting library 'glib'. Qt is now configured for building. Just run 'make'. Once everything is built, you must run 'make install'. Qt will be installed into '/home/mango/raspi/qt5pi'. Prior to reconfiguration, make sure you remove any leftovers from the previous build. mango@ubuntu:~/raspi/qtbase$ |
- make -j4 로 빌드하고 나면 아래와 같이 무사히 빌드된 화면이 나옵니다.
rm -f libqeglfs-kms-integration.so /home/mango/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/mango/raspi/sysroot -Wl,--no-undefined -Wl,--no-undefined -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,\$ORIGIN/../../lib -Wl,-rpath-link,/home/mango/raspi/qtbase/lib -Wl,-rpath-link,/home/mango/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/mango/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/mango/raspi/sysroot/lib/arm-linux-gnueabihf -shared -o libqeglfs-kms-integration.so .obj/qeglfskmsgbmmain.o .obj/qeglfskmsgbmintegration.o .obj/qeglfskmsgbmdevice.o .obj/qeglfskmsgbmscreen.o .obj/qeglfskmsgbmcursor.o .obj/moc_qeglfskmsgbmcursor.o -L=/opt/vc/lib -L/home/mango/raspi/qtbase/lib -L/home/mango/raspi/sysroot/usr/lib/arm-linux-gnueabihf -L/home/mango/raspi/sysroot/lib/arm-linux-gnueabihf -lQt5EglFsKmsSupport -lQt5EglFSDeviceIntegration -lQt5EventDispatcherSupport -lgthread-2.0 -lglib-2.0 -lQt5ServiceSupport -lQt5ThemeSupport -lQt5DBus -lQt5FontDatabaseSupport -lfontconfig -lfreetype -lQt5FbSupport -lQt5EglSupport -lXext -lX11 -lm -lEGL -lQt5InputSupport -lmtdev -linput -lxkbcommon -lQt5PlatformCompositorSupport -lQt5KmsSupport -lQt5Gui -lQt5DeviceDiscoverySupport -ludev -lQt5Core -lGLESv2 -lpthread -lgbm -ldrm -ldl -lts -lEGL -lGLESv2 mv -f libqeglfs-kms-integration.so ../../../../../../plugins/egldeviceintegrations/libqeglfs-kms-integration.so make[6]: Leaving directory `/home/mango/raspi/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms' make[5]: Leaving directory `/home/mango/raspi/qtbase/src/plugins/platforms/eglfs/deviceintegration' make[4]: Leaving directory `/home/mango/raspi/qtbase/src/plugins/platforms/eglfs' make[3]: Leaving directory `/home/mango/raspi/qtbase/src/plugins/platforms' make[2]: Leaving directory `/home/mango/raspi/qtbase/src/plugins' make[1]: Leaving directory `/home/mango/raspi/qtbase/src' mango@ubuntu:~/raspi/qtbase$ |
-모듈의 추가빌드:
위와 와 같이 하나 하나 하면 된다. 문제가 안되게 빌드하려면 아래의 순서대로 빌드를 해야한다. (패키지별로 종속적인 관계가 있다.) qtimageformats, qtsvg, qtscript, qtxmlpatterns, qtdeclarative, qtsensors, qt3d, qtgraphicaleffects, qtjsondb, qtlocation, qtdocgallery 테스트를 해보니까 최소한 qtdeclarative 까지는 설치하는 것이 좋을 것 같다. [출처] 라즈베리파이 + QT5 크로스컴파일 포팅하기 (Embedded Crazy Boys) |작성자 천동이 |
13. 수정
echo /usr/local/qt5pi/lib | sudo tee /etc/ld.so.conf.d/00-qt5pi.conf sudo ldconfig |
14.수정
pi@raspberrypi:~ $ sudo mv /usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0 /usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0_backup pi@raspberrypi:~ $ sudo mv /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0 /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0_backup pi@raspberrypi:~ $ sudo ln -s /opt/vc/lib/libEGL.so /usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0 pi@raspberrypi:~ $ p bash: p: command not found pi@raspberrypi:~ $ sudo ln -s /opt/vc/lib/libGLESv2.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0 pi@raspberrypi:~ $ sudo ln -s /opt/vc/lib/libbrcmEGL.so /opt/vc/lib/libEGL.so ln: failed to create symbolic link '/opt/vc/lib/libEGL.so': File exists pi@raspberrypi:~ $ sudo mv /opt/vc/lib/libbrcmEGL.so /opt/vc/lib/libbrcmEGL.so_backup pi@raspberrypi:~ $ pi@raspberrypi:~ $ pi@raspberrypi:~ $ sudo ln -s /opt/vc/lib/libbrcmEGL.so /opt/vc/lib/libEGL.soln: failed to create symbolic link '/opt/vc/lib/libEGL.so': File exists pi@raspberrypi:~ $ ll /opt/vc/lib/libbrcmEGL.so* -rw-r--r-- 1 root root 202072 Feb 18 19:10 /opt/vc/lib/libbrcmEGL.so_backup pi@raspberrypi:~ $ pi@raspberrypi:~ $ pi@raspberrypi:~ $ pi@raspberrypi:~ $ sudo mv /opt/vc/lib/libEGL.so /opt/vc/lib/libEGL.so_backup pi@raspberrypi:~ $ sudo ln -s /opt/vc/lib/libbrcmEGL.so /opt/vc/lib/libEGL.sopi@raspberrypi:~ $ pi@raspberrypi:~ $ sudo mv /opt/vc/lib/libGLESv2.so /opt/vc/lib/libGLESv2.so_backup pi@raspberrypi:~ $ sudo ln -s /opt/vc/lib/libbrcmGLESv2.so.2 /opt/vc/lib/libGLESv2.so
또는 아래 같이 순서로 진행한 히스토리이니, 작업후 재검증(확인,?)이 필요함. pi@raspberrypi:~/qt/SimpleQtExample $ history | tail -n 20 |
15.
'board_android-IoT > raspberry_pi3' 카테고리의 다른 글
라즈베리파이 아날로그핀으로 20V 입력받는 방법 (0) | 2020.05.21 |
---|---|
파이썬+Eclipse로 라즈베리파이 개발환경꾸미기 (0) | 2020.05.20 |
RaspberryPi3 Qt cross-compile environment in windows (0) | 2019.04.16 |
omxplayer Video Play in Vertical (0) | 2017.06.16 |
getting-cpu-temperature (0) | 2017.05.03 |