Build an ARM development environment for QtCreator under Fedora12 and port Qt4.6.2 to Micro2440

Source: Internet
Author: User
Environment: Virtual Machine Fedora12 (we recommend that you install VmwareTools. For detailed installation instructions, see the Vmware help documentation), USB serial port, and mini-com terminal. (Minicom often cannot open the ttyUSB0 device. My solution is to remove the USB serial port when it cannot be opened, run minicom, and then connect the USB serial port. At this time, minicom can usually open the device) software preparation: Go to http://qt.nokia.com/downloads-cnin environment: Virtual Machine Fedora12 (we recommend that you install Vmware Tools. For details about the installation method, refer to the Vmware help documentation), USB serial port, minicom terminal. (Minicom often cannot open the ttyUSB0 device. My solution is to remove the USB serial port when it cannot be opened, run minicom, and then connect the USB serial port. At this time, minicom can usually open the device)
Software preparation: download the latest software package at http://qt.nokia.com/downloads-cn:
Qt Creator 1.3.1 Binary Package qt-creator-linux-x86-opensource-1.3.1.bin (http://qt.nokia.com/downloads/qt-creator-binary-for-linux-x11-32-bit) for Linux/X11 32-bit)
Qt 4.6.2packet qt-everywhere-opensource-src-4.6.2.tar.gz (http://qt.nokia.com/downloads/embedded-linux-cpp) for Embedded Linux)
To arm-linux-gcc-4.1.2 (that is, http://qtextended.org/downloads/toolchains/arm920t-eabi.tgz)
Download root_qtopia. I use the root_qtopia-20100108.tar.gz file in the youshanguang disk, and download tslib1.4 and tslib1.4 to FTP Server 1 of the Linux community. For details, see:

Http://www.linuxidc.com/Linux/2011-08/40398.htm


Decompress the qt-everywhere-opensource-src-4.6.2.tar.gz package into three parts, respectively compile PC, embedded x86 and arm three versions.
Create a tmpfolder in the rootdirectory. Decompress qt-everywhere-opensource-src-4.6.2.tar.gz and copy the folder for 2 minutes, named pc, x86, and arm respectively.

1. Compile the PC version: Enter the pc directory #./configure # gmake install. The installation process is long and has not encountered any errors.
2. compile the embedded x86 version: Enter the x86 directory #. /configure-embedded x86-qt-gfx-qvfb-qt-kbd-qvfb-qt-mouse-qvfb # gmake install has a long installation process and has not encountered any errors.
Compile and install qvfb in pc: Enter the pc/tools/qvfb/directory # make compilation is complete, copy the qvfb file under the pc/bin directory to the/usr/local/Trolltech/QtEmbedded-4.6.2/bin directory.
3. compile the Embedded arm version (which must be supported by arm-linux-gcc): the Embedded ARM-Linux GCC 4.3.2 is compiled. After the program is transplanted to the Development Board, the Segmentation Fault error occurs, press the original text and use 4.1.2.
Decompress the arm920t-eabi.tgz directly to the root directory, and it cannot be "I put it in:/usr/local/arm/4.1.2 /", at least an error occurred when I put it in the past. Add the compiler path to the system environment variable and run the command: # gedit/root /. bashrc edit/root /. bashrc file, add export PATH =/opt/toolchains/arm920t-eabi/bin: $ PATH to the last line

Compile tslib for touch screen support: Download, tslib1.4.tar.gz, decompress :#. /configure -- prefix =/usr/local/tslib/-- host = arm-linux ac_cv_func_malloc_0_nonnull = yes # make install the downloaded package does not have a configure file. You need to run autogen. sh.
Set environment variables so that relevant libraries can be found during compilation: # Export CPLUS_INCLUDE_PATH =/opt/toolchains/arm920t-eabi/arm-angstrom-linux-gnueabi/include/c ++: /opt/toolchains/arm920t-eabi/arm-angstrom-linux-gnueabi/include/c ++/arm-none-linux-gnueabi # Export PATH =/opt/toolchains/arm920t-eabi/bin: $ PATH
Modify The qt-everywhere-opensource-src-4.6.2/mkspecs/qws/linux-arm-g ++/qmake. conf File (add Lts Parameters ): QMAKE_CC = arm-linux-gcc-lts QMAKE_CXX = arm-linux-g ++-lts QMAKE_LINK = arm-linux-g ++-lts QMAKE_LINK_SHLIB = arm-linux-g ++-lts This step must be in place. Otherwise, an error will occur.
Configuration:" -Prefix/usr/local/Trolltech/QtEmbedded-4.6.2-arm'Parameter, otherwise it will not be in the QtEmbedded-4.6.2-arm folder after installation, but will overwrite the QtEmbedded-4.6.2. #./Configure \ -Prefix/usr/local/Trolltech/QtEmbedded-4.6.2-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-openssl \-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
The blue content that is marked out above can be avoided, so that the editing will not go wrong (the virtual machine is broken and has to be reinstalled. When configuring parameters, you forget to do the above work, and the result shows that there is no error ).

For configuration parameters, refer to this article. You can use configure-embedded-help to view them.

If you discard the configuration, run the following command: # gmake confclean
Compile: # gmake
Install: # gmake install
After installation is complete, there are three folders in the/usr/local/Trolltech Directory: Qt-4.6.2, QtEmbedded-4.6.2, QtEmbedded-4.6.2-arm.
4. Port the system I started through NFS. For more information, see the friendly manual. Download The nfsboot system at http://www.arm9.net/download.asp. in section 5.5.3.
Copy all files on Fedora12/usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib to the/opt/FriendlyARM/mini2440/root_qtopia/usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib directory (corresponding directory) copy, it is equivalent to copying it to the corresponding directory of the Development Board). You can crop it as needed. Read the original article.
Copy the database in/usr/local/tslib on Fedora12 to/opt/FriendlyARM/mini2440/root_qtopia/usr/local. Copy all files under/usr/local/tslib to the/opt/FriendlyARM/mini2440/root_qtopia/usr/local folder.
If other libraries are missing at runtime, the replication method is the same. You can also run the "arm-angstrom-linux-gnueabi-readelf-a program name | grep" Share "command to check which shared libraries are required and copy them together.
To support touch screen, set the environment variable automatically at startup. append the following value to/etc/profile in 2440: export LD_LIBRARY_PATH =/usr/local/lib: $ QTDIR/lib: $ export TSLIB_ROOT =/usr/local/lib export TSLIB_TSDEVICE =/dev/input/event0export TSLIB_FBDEVICE =/dev/fb0 export =/usr/local/lib/tsexport TSLIB_CONSOLEDEVICE = noneexport TSLIB_CONFFILE =/usr/local/etc/ts. confexport POINTERCAL_FILE =/etc/pointercalexport TSLIB_CALIBFILE =/etc/pointercalexport QWS_MOUSE_PROTO = Tslib:/dev/input/event0
Cancel the first comment in/usr/local/etc/ts. conf: # module_raw input
Start Micro2440 to run/usr/local/bin/ts_calibrate correction touch screen.
Now the transplantation of Qt4.6.2 has come to an end. If you run the program compiled by Qt4.6.2-arm on the Development Board, "relocation error: /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/libQtGui. so.4: symbol powf, version GLIBCXX_3.4 not defined in file libstdc ++. so.6 with link time reference "error.
Related Article

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.