1. Transplant preparation
1.1 environment and resources required for compilation
1, QT source package: qt4.6 source package: qt-everywhere-opensource-src-4.6.3.tar.gz
2. Cross-compilation tool: arm-linux-gcc-4.4.3-20100728.tar
3, touch screen verification tool: tslib-1.4.tar.gz
4. OS environment running on PC: ubuntu10.10
5. mini2440 Development Board
1.2 install the Cross Compiler
Put the cross-compilation toolkit in the root directory and execute the following command:
- Tar zxvf arm-linux-gcc-4.4.3-20100728.tar-C/
Decompress the package and generate a directory:/opt/friendlyarm/toolschain/4.4.3. Enter the directory, enter the bin directory, and run the following command:
- PWD>/root/. bashrc
Run the following command:
- VI/root/. bashrc
Then modify the last line: Export Path =/opt/friendlyarm/toolschain/4.4.3/bin: $ path
To make the configuration environment take effect immediately, run the following command:
- Source/root/. bashrc
View the version information and run the following command:
- Arm-Linux-gcc-V
If the correct version is displayed, the cross compiler is successfully configured.
1.3 install touch screen verification tools
Put tslib-1.4.tar.gz in a directory, for example,/OPT. Run the following command:
- Tar zxvf tslib-1.4.tar.gz
Run the CD tslib command to enter the current directory of tslib. Then run the following command:
- Source autogen. Sh
Then run the configuration command:
- ./Configure -- prefix =/usr/local/tslib -- Host = arm-linuxac_cv_func_malloc_0_nonnull = Yes
Finally, execute the compilation command and installation command as follows:
- Make
- Make install
If the above steps are correct, we can see the library files we need under/usr/local/tslib, which will be used for porting.
1.4 compile the Qt-4.6.3 Library File
Put qt-everywhere-opensource-src-4.6.3.tar.gz in the/OPT directory. Run the following command:
- Tar zxvf qt-everywhere-opensource-src-4.6.3.tar.gz
Then decompress the Directory into a qt-embeded-4.6.3-arm, execute the command as follows:
- MV qt-everywhere-opensource-src-4.6.3.tar.gz qt-embedded-4.6.3-arm
Go to the qt-embedded-4.6.3-arm and run the configuration command as follows:
- ./Configure-Prefix/usr/local/trolltech/QtEmbedded-4.6.3-arm-opensource-confirm-license-release-shared-Embedded ARM-xplatform
- Qws/Linux-arm-G ++-Depths 16,18, 24-fast-optimized-qmake-PCH-QT-SQL-SQLite-QT-libjpeg-QT-zlib-QT-libpng-QT-FreeType
- -Little-Endian-host-little-Endian-no-qt3support-no-LibTIFF-no-libmng-no-OpenGL-no-MMX-no-SSE-no-sse2-no-3dnow-no-WebKit
- -No-qvfb-no-phonon-no-Nis-no-OpenGL-no-cups-no-glib-no-xcursor-no-xfixes-no-xrandroid-no-xrender -No-separate-debug-Info
- -Nomake examples-nomake tools-nomake docs-QT-mouse-tslib-I/usr/local/tslib/include-L/usr/local/tslib/lib
Run the following command to continue the compilation and installation:
- Make
- Make install
If the above is successful, you will see the QT library file based on the arm processing platform under the directory/usr/local/trolltech/QtEmbedded-4.6.3-arm.
2. Start porting
2.1 port the Library to the mini2440 Development Board
Create a directory on the Development Board as follows:
- /Usr/local/trolltech/QtEmbedded-4.6.3-arm/bin.
- // Usr/local/trolltech/QtEmbedded-4.6.3-arm/lib/Fonts
- /Usr/local/tslib
Copy the required Runtime Library
Copy all files under/usr/local/trolltech/QtEmbedded-4.6.3/lib/compiled on PC to/usr/local/trolltech/QtEmbedded-4.6.3-arm/lib/
Copy touch screen Software
Copy all the files in the/usr/local/tslib/directory compiled and installed on the PC to the Development Board/usr/local/tslib.
2.2 create environment variables at mini2440
Run the following command: VI/etc/profile:
- Export qtdir =/usr/local/trolltech/QtEmbedded-4.6.3-arm
- Export qpedir =/usr/local/trolltech/QtEmbedded-4.6.3-arm
- Export tslib_root =/usr/local/tslib
- Export Path = $ qtdir/bin: $ path
- Export tslib_consoledevice = none
- Export tslib_fbdevice =/dev/fb0
- Export tslib_tsdevice =/dev/input/event0
- Export tslib_plugindir = $ tslib_root/lib/TS
- Export tslib_conffile = $ tslib_root/etc/ts. conf
- Export tslib_calibfile =/etc/pointercal
- Export qws_mouse_proto = tslib:/dev/input/event0
- Export qws_display = linuxfb:/dev/fb0
- Export qws_size = 240x320
- Export LD_LIBRARY_PATH = $ tslib_root/lib: $ qtdir/lib:/usr/local/lib: $ LD_LIBRARY_PATH
Modify the/usr/local/tslib/etc/ts. conf file on mini2440: remove the # And space before # module_raw input in the second line, save and exit.
2.3 porting implementation
First, compile on the PC, enter the program (test_hello) directory, and then execute the following command:
- // Usr/local/trolltech/QtEmbedded-4.6.3-arm/bin/qmake
Then execute the compile command: Make
After execution, run the following command: whether file test_hello is a binary file. If yes, it indicates that the compilation is successful and can be transplanted to the mini2440 Development Board.
Copy the compiled program test_hello to the development board/usr/local/trolltech/QtEmbedded-4.6.3-arm/bin/directory through the USB flash drive.
Then run./test_hello-qws-fonts wenquanyi on the terminal. If your program appears on the Development Board, the execution is successful.
After practical experiments, it is confirmed that the cross compiler should use the cross compiler tool: arm-linux-gcc-4.4.3-20100728.tar
If version 4.3.2 is used, the cause of the error is always unknown.