QTE porting Environment Variables

Source: Internet
Author: User
Time: qtembeded transplanted to the Da Vinci 6441 Platform

Preface:
As far as porting QTE is concerned, this dish is already a skilled tool. Therefore, it is not very difficult to transplant it to the Da Vinci 6441 platform. However, it was found that there were not many materials for migration in China, and only OMAP was involved. In addition, the tool chain and Linux were still difficult to produce, so I wrote an article to help later users. NFS is used to share the root file system during the migration process. If NFS is not used, change it as needed.
Body:
First, we will give a brief introduction to the transplanted environment:
Development Board: Da Vinci 6441 chipset (arm9-+ C64x +)
Host system: Redhat Enterprise Linux 4
Host Compiler: GCC version 3.4.3 20041212 (Red Hat 3.4.3-9. EL4)
Cross Compiler: arm_v5t_le-gcc (provided by montavista)
Porting process:
Preparations before migration
Before porting the qt4 graphics development library, you should first obtain the latest source code of qt4 corresponding to embedded development. The latest source code of qt4 can be obtained on its official website: http://www.qtsoftware.com/downloads. To facilitate development, you can use qvfb on a PC to simulate the running of qt4 on embedded devices. To clarify the concept, the qt4 graphic development library corresponds to the PC Desktop Development Board named qt4 and the embedded device development board named qte4.
Decompress the source package
Generally, you need to obtain two source code packages. After downloading them from the official website, you should have the following two compressed packages:
Qt-embedded-linux-opensource-src-4.5.2.tar.gz
Qt-x11-opensource-src-4.5.2.tar.gz
The two correspond to the qt4 graphics library developed on the Linux desktop and the graphics library developed on the embedded Linux device respectively. Use the tar command to decompress the two source code packages for configuration compilation and development. The process is as follows:
# Tar zxvf qt-embedded-linux-opensource-src-4.5.2.tar.gz
# Tar zxvf qt-x11-opensource-src-4.5.2.tar.gz
Configure, compile, and install tslib
Tslib is an open-source program that provides functions such as filtering, deshake, and calibration for the sampling obtained by the touch screen driver. It is usually used as the Adaptation Layer of the touch screen driver, provides a unified interface for upper-layer applications. Tslib can be used to provide the prepared touch screen data for qt4 programs, facilitating the positioning of program touch.
Similarly, download and obtain the tslib source code, decompress it to the specified folder, and configure the compilation and installation as follows:
#./Autogen. Sh
#./Configure-Prefix =/home/wangc/mytslib/-host = arm-Linux ac_cv_func_malloc_0
_ Nonnull = Yes
# Make
# Make install
After the installation is successful, tslib will be installed in the mytslib directory. to specify the installation directory, modify the installation directory after the prefix parameter.
Configure and compile qte4
After the preparation is complete, you can compile the configuration of qte4. Because qte4 is a huge graphics library for embedded devices, you need to configure and crop the parameters. Because the cross tool chain is different from the general cross tool chain, you need to modify the compilation script for the ARM platform to proceed normally.
In the extract directory of qte4, go to the mkspecs/qws/Linux-arm-G ++/directory and name it qmake. CONF file, configure the cross tool chain Selection in it, and change all arm-Linux-to arm_v5t_le-to specify the cross tool chain of the Da Vinci platform.
Configure qte4
Select parameters as needed, and enter the source code extraction directory for configuration. The steps are as follows:
#. /Configure-release-shared-fast-no-largefile-QT-SQL-SQLite-no-qt3support-no-xmlpatterns-no-phonon-backend-no-scripttools-No -MMX-no-3dnow-no-SSE-no-sse2-nomake tools-nomake examples-nomake docs-nomake demo-xplatform qws/Linux-arm-G ++-Embedded ARM-little-Endian -QT-FreeType-QT-GFX-linuxfb-no-GFX-transformed-no-GFX-multiscreen-no-GFX-VNC-no-GFX-qvfb-QT-KBD-USB -No-glib-QT-mouse-tslib-I/home/wangc/mytslib/include-L/home/wangc/mytslib/lib
In parameter selection, tslib should be selected for the touch screen, and the header file and library file directory of tslib should be specified.
Compile qte4
After configuration, You can compile qte4 by following the steps below:
# Make
The length of compilation depends on the performance of the compilation machine and the configuration parameters. After compilation, you can obtain the required qte4 library file.
Port qte4
After compilation, qte4 should be installed on the PC to facilitate future development. In this way, qte4's qmake tool and phase
Close the document. The installation command is as follows:
# Make install
To run the qt4 program on the Development Board, there should be a corresponding library file. The porting process is to move the library file that has been compiled by crossover to the Development Board. The Development Board can be started using the NFS shared root file system. Therefore, you can first copy the library file to the shared root file system for testing. After the test is complete, copy the library file to the Development Board.
Transplant library files
Follow these steps to first copy the qte4 library file to the root file system started by NFS. The steps are as follows:
# Cp-F lib/rootfs/usr/local/trolltech/QtEmbedded-4.5.0-arm
This is the default installation directory of QTE, which can avoid unnecessary problems due to different paths.
Set Environment Variables
After the root file is copied to the specified location, to enable the system to obtain the qte4 library file location at runtime, you should set the system environment variables. The configured environment variables are as follows:
Export qtedir =/usr/local/trolltech/QtEmbedded-4.5.0-arm
Export Path =/usr/local/trolltech/QtEmbedded-4.5.0-arm/bin: $ path
Export qws_display = linuxfb:/dev/FB/0
Export qws_display = "linuxfb: mmwidth720: mmheight272: 0 ″
Export qws_size = 720 × 272
Export LD_LIBRARY_PATH =/usr/local/trolltech/QtEmbedded-4.5.0-arm/lib: $ LD_LIBRARY_PATH
The first parameter specifies the directory where the QTE is located, the second parameter is to import the directory where the QTE is located into the environment variable, and the third and fourth Parameters specify the QTE plotting device, the fifth parameter is to import the QTE library file directory to the environment variable.
Possible errors:
During the migration process, errors may occur due to differences in the hardware system and system environment. Therefore, you must analyze and solve these errors one by one.
Problem 1: Root-NFS: Unable to get nfsd port number from server, using default
Cause: This is usually caused by NFS configuration problems or network cables.
Solution: Check whether the network cable is properly connected and the configuration is correct.
Problem 2: The tslib test program cannot be executed
Cause: after checking the connection relationship, the target desktop is x86.
Solution: The reason is that the naming rules of the Cross-compilation tool are different from those of common tools. You can import the tool to the compilation terminal before compilation.
Question 3:./findfiles: Error while loading shared libraries: libstdc ++. so.6: cannot open shared object file: no such file or directory
Cause: the library files on the Development Board are inconsistent with those on the PC.
Solution: The file is in the/opt/mv_pro_4.0/montavista/Pro/devkit/ARM/v5t_le/target/usr/lib/directory, copy it to the Development Board/usr/lib directory.
Question 4: qscreenlinuxfb: CONNECT: no such file or directory
Error opening framebuffer device/dev/fb0
: Driver cannot connect
Aborted
Cause: the default frame cache device of the program is/dev/fb0, but the device is actually/dev/FB/0. Therefore, the device cannot be opened when an error occurs.
Solution: ln-S/dev/FB/0/dev/fb0. Create a link so that fb0 points to/dev/FB/0, and then the program runs smoothly.
The specific problem still needs to be analyzed and solved according to your own development environment.
All posts on this site are reserved by this site and the original author. This article can only be reproduced if the copyright information, original article links, and original article authors are retained. Do not delete or modify the original article content for reprinting, it is not intended for commercial purposes. Thank you for your cooperation.
This article from: http://www.cuteqt.com/blog? P = 898

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.