The following system for ubuntu16.04, Development Board for the itop4412,4.3 inch screen.
Download qt5.7 Source Qt-everywhere-opensource-src-5.7.0.tar.xz
Http://www.download3k.com/Install-Qt.html
Arm cross-compilation tool download arm-2014.05-29-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
http://www.veryarm.com/arm-none-linux-gnueabi-gcc
Download tslib1.4
http://vdisk.weibo.com/s/AcUHxOERV2k0?sudaref=www.baidu.com arm Cross compiler arm-2014 installation
Extract "arm-2014.05-29-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2" into the folder "/usr/local/arm" of the Ubuntu system.
Then modify the environment variable, switch to the home directory, and then enter the command "vim. BASHRC" To open the file ". BASHRC" Setting the environment variable to "Export path= $PATH:/usr/local/arm/ Arm-2014.05/bin "
Save the exit, then update the environment variable, and enter the command "source. BASHRC".
source. BASHRC
Next Test, the compiler path is set correctly. In the following figure, enter the command "arm" on the Ubuntu command line,
Then press "tab" on the keyboard, and the compiler "arm-none-linux-gnueabi-gcc-4.8.2" appears, which means compiling
The path to the device is set correctly. cross-compile tslib1.4
To the touch screen signal acquisition, correction, filtering processing, using open source Tslib, this article uses the Tslib version for the latest tslib1.4 (can be downloaded from the link provided in this article tslib1.4).
1. Copy the downloaded tslib1.4 to the/home/lz/transplant directory (you can select a directory according to your system), and then perform the decompression command
TAR-VXF tslib-1.4.tar.gz
Switch to Tslib directory:
CD Tslib
Install some of the tools that you must have to cross-compile tslib (you can first see if it's installed, ubuntu16.04 take these tools, skip it)
sudo apt-get install autoconf
sudo apt-get install automake sudo apt-get install Libtool
2. Using scripting to write the compilation process
Create a new file under the Tslib folder configtslib14.sh
VI configtslib14.sh
The contents are as follows:
#!/bin/sh make
&& make Distclean
echo "Ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache
cc=/usr/local/arm/arm-2014.05/bin/arm-none-linux-gnueabi-gcc./configure--host=arm-linux--prefix=/opt/ tslib1.4--cache-file=arm-linux.cache make
&& make install
Then run configtslib14.sh
./configtslib14.sh
After the execution, let's check to see if the installation was successful and execute the command:
ls/opt/tslib1.4
If the 4 directories of Bin,etc,include,lib appear, as shown in the following illustration, it is tslib successful to cross-compile and install.
cross-compile QT5.7.0
Unzip the downloaded qt-everywhere-opensource-src-5.7.0.tar.gz by executing the following command:
TAR-VXF qt-everywhere-opensource-src-5.7.0.tar.gz
CD qt-everywhere-opensource-src-5.7.0
To modify the information used by the cross-compilation schema:
Gedit qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf
Modify the following image:
# #
Qmake configuration for building with arm-linux-gnueabi-g++
#
Makefile_generator = UNIX
CONFIG + = incremental
Qmake_incremental_style = sublib
qt_qpa_default_platform = Linux #eglfs
qmake_ Cflags_release + +-o2-march=armv7-a
qmake_cxxflags_release + =-o2-march=armv7-a
include (.. /common/linux.conf)
include (.. /common/gcc-base-unix.conf)
include (.. /common/g++-unix.conf)
# Modifications to g++.conf
qmake_cc = ARM-NONE-LINUX-GNUEABI-GCC
QMAKE _cxx = arm-none-linux-gnueabi-g++
qmake_link = arm-none-linux-gnueabi-g++
qmake_link_shlib = arm-none-linux-gnueabi-g++
# modifications to linux.conf
qmake_ar = Arm-none-linux-gnueabi-ar CQS
qmake_objcopy = arm-none-linux-gnueabi-objcopy
qmake_nm = Arm-none-linux-gnueabi-nm-p
Qmake_strip = Arm-none-linux-gnueabi-strip
load (qt_config)
Create a script file to generate makefile, execute command
Gedit autoconfigure.sh
Enter the following content and save:
#!/bin/sh
./configure \
v \
-prefix/opt/qt-5.7.0 \
-release \
-opensource \
- no-accessibility
-make libs \
-xplatform linux-arm-gnueabi-g++ \-optimized-qmake \
-pch \
- Qt-sql-sqlite \
-qt-zlib \
-tslib \
-no-opengl \
-no-sse2 \
-no-openssl \
-no-nis \
-no-cups \
-no-glib \
-no-pkg-config \
-no-separate-debug-info \
-i/opt/tslib1.4/include -l/opt/tslib1.4/lib
where-prefix/opt/qt-5.7.0 on behalf of us after compiling the QT5.4.1 to install the address;-tslib represents QT support for the touchpad, followed by-I and-l, respectively, to compile the Tslib installation directory for include and Lib for the first step.
To execute a command:
chmod 777 qt.configure.sh
./autoconfigure.sh
The above command automatically generates makefile files.
To execute a command to start a compilation:
Make
Compile about 2 hours.
After the compilation completes, execute the install command:
sudo make install
Let's switch to the target directory to see if the installation is successful:
cd/opt/qt-5.7.0
ls
As shown in the figure:
Copy/opt/qt-5.7.0 and/opt/tslib1.4 to the corresponding directory in the Development Board's file system. setting up a cross-compilation environment for QT
Install Qtcreator
Enter the Qtcreator development environment
Select Tools--options in the menu, in the pop-up dialog box, select Build & Run, select the label compilers, follow the chart settings, select the C + + cross compiler, as shown in the following figure:
Switch to the QT versions tab, click the "Add" button and select Qmake as shown in the picture:
Select Finish, press "OK" button, set as shown in the picture:
Switch to the Kits tab, click the "Add" button, and then set the following image:
Configure tslib on the 4412 Development Board and cross-compile a QT application that can run on the 4412 Development Board
Copy the font Ubuntu_l.ttf and other fonts to/opt/qt-5.7.0/lib/fonts
In the Development Board Serial Command window, enter:
Vi/etc/profile
As shown in the following illustration:
Modify it to the following
Export tslib_root=/opt/tslib1.4
export qt_root=/opt/qt-5.7.0
export Tslib_tsdevice=/dev/input/event2
Export tslib_tseventtype=input
export tslib_conffile=/opt/tslib1.4/etc/ts.conf
export tslib_plugindir=/ Opt/tslib1.4/lib/ts
export tslib_consoledevice=none
export tslib_fbdevice=/dev/fb0 export
qws_mouse_ Proto=tslib:/dev/input/event2
export ld_library_path=/lib:/usr/lib:/usr/local/lib: $QT _root/lib: $TSLIB _root/ Lib: $TSLIB _root/lib/
export qt_qpa_platform_plugin_path= $QT _root/plugins
export QT_QPA_PLATFORM=LINUXFB : tty=/dev/fb0
export qt_qpa_fontdir= $QT _root/lib/fonts
export Qt_qpa_generic_plugins=tslib
Save exit, execute command (be sure to execute, or it may error):
Source/etc/profile
Then enter vi/opt/tslib1.4/etc/ts.conf in the Serial Command window to configure the touch screen
Remove the comment from the second line and set the TS into input mode (note that the preceding spaces are also removed)
A test program is written below to test the Development Board
Open Qtcreator, create a new item, drag a few buttons up, as shown in the following figure
Compile the executable program untitled, look at it, you can see its information displayed as the ARM platform, as shown in the following figure
Copy the untitled to the/bin directory of the file system in the Development Board and run the program.
Take a look at the board: