How to Create a QT/Embedded Development Environment

Source: Internet
Author: User
How to Create a QT/Embedded Development Environment
   
  Friendlyarm
   
  This article applies to any type of Target Board Based On S3C2410X.
  Note:To ensure that you can correctly perform the steps described in this document, follow"Fully install RedHat 9.0 step by step"Install your RedHat 9.0 system correctly
   
   
  1. decompress the source code and configure the path of the QT library.
  2. Use the build script to compile QT/embedded
  3. Hello SBC-2410X for x86
  4. Hello, SBC-2410X for ARM
  5. Common compilation errors
   
  1. decompress the source code and configure the path of the QT library.
   
  Put the CD in the DVD-ROM and perform the following steps:
  Step 1 mount the CD
# Mount/dev/CDROM/mnt/CDROM

Step 2 go to the QT Development Kit directory
# Cd/mnt/CDROM/SBC-2410X-Linux/emgui

Step 3 install the source code of QT and qtopia for x86
# Tar xvzf x86-qtopia.tgz-C/friendly-arm # This step will generate a x86-qtopia directory under/friendly-arm

Step 4 install the qtopia source code for the SBC-2410X version
# Tar xvzf arm-qtopia.tgz-C/friendly-arm # This step will generate the arm-qtopia directory under the/friendly-arm directory

Step 5 pop up the disc
# Cd/
# Eject

   
  To simulate qtopia running on a PC, you need to use the library file of the corresponding QT version. Therefore, you need to modify/Etc/lD. So. confFile to adapt to the just-installed QT (RedHat installation with QT library, but not the latest version), the modified lD. So. conf file content is as follows:
/Friendly-arm/x86-qtopia/QT/lib
/Friendly-arm/x86-qtopia/qtopia/lib
/Usr/Kerberos/lib
/Usr/x11r6/lib
/Usr/lib/sane
/Usr/lib/MySQL
   
   
  2. Use the build script to compile QT/embedded
   
  (1)Compile QT/embedded for x86
  #CD/friendly-arm/x86-qtopia
#./Build (this process is relatively long and it takes about 30 minutes to run)
#Ldconfig
  Note: ldconfig is run once to make the generated QT and qtopia libraries valid.
   
  (2)Simulate qtopia running on PC
  #Qvfb &
  #Qtopia
   
   
   
  3. Hello SBC-2410X for x86
   
  (1)Compile hello, SBC-2410X
  # Cd/friendly-arm/x86-qtopia
#. Set-env; note that there is a space in the middle. It must be available for execution!
# Cd hello
# Make
  The Hello executable file will be generated in the/friendly-arm/x86-qtopia/qtopia/bin directory
   
  (2)Run hello, SBC-2410X separately
  # Qvfb-width 640-height 480 &
  # Hello-qws
 
 
Run hello, SBC-2410X separately in qvfb
   
  (3)Run hello, SBC-2410X in qtopia
  # Qvfb-width 640-height 480 &
  # Qpe
 
 
Hello, SBC-2410X in qtopia
   
   
  4. Hello, SBC-2410X for ARM
   
  (1)Compile QT/embedded for ARM
  # Cd/friendly-arm/ARM-qtopia
#./Build (this process is relatively long and it takes about 30 minutes to run)
   
  (2)Compile hello, SBC-2410X for ARM
  # Cd hello
# Make
  After compilation, hello will be generated in the/friendly-arm/ARM-qtopia/bin directory.
   
  (3)Download hello to the target board
 

There are currently two main ways to move executable files to SBC-2410X:

  Method 1:Copy to media (the following uses a USB flash drive as an example)
  # Mount/dev/sda1/mnt
# Cp Hello/mnt
# Umount/mnt
Unplug the USB flash drive and insert it to the USB host port of the SBC-2410X by following the command below:
# Mount/dev/sda1/MNT; mount the USB flash drive
# Cp/mnt/Hello/opt/qtopia/bin; copy hello to the/opt/qtopia/bin directory
   
  Method 2:Move through the network (recommended)
  The main steps to download programs over the network are: First copy hello to the FTP shared directory, then use ftp to download on the SBC-2410X, and modify the execution permission to run, as shown below:
Run the following command on the PC:
# Cp Hello/home/FTP; copy hello to the FTP shared directory
On the SBC-2410X side, execute:
# Cd/opt/qtopia/bin; enter the bin directory
# Ftp 192.168.0.1; log on to the FTP server
> Get hello; download hello
> Bye; log out of FTP
# Chmod A + x hello; change the executable permission of Hello
   
  (4)Run hello on the target board
  Export set home =/root
Export set qtdir =/opt/QT
Export set qpedir =/opt/qtopia
Export set qws_keyboard = "USB:/dev/input/event1"
Export set qws_mouse_proto = "USB:/dev/input/mouse0"
Export set Path = $ qpedir/bin: $ path
Export set LD_LIBRARY_PATH = $ qtdir/lib: $ qpedir/lib
$ Qpedir/bin/Hello-qws
   
  (5)Run hello in qtopia
  Export set home =/root
Export set qtdir =/opt/QT
Export set qpedir =/opt/qtopia
Export set qws_keyboard = "USB:/dev/input/event1"
Export set qws_mouse_proto = "USB:/dev/input/mouse0"
Export set Path = $ qpedir/bin: $ path
Export set LD_LIBRARY_PATH = $ qtdir/lib: $ qpedir/lib
$ Qpedir/bin/qpe>/dev/null 2>/dev/null
   
   
  5. Common compilation errors
   
  (1)Errors During build
  ./Build after a long time, the final display is as follows
Makefiles will be regenerated.
........................................ .........................................
Qpe is now configured for building. Just run "make ".
To reconfigure, run make clean and configure.

Make-C libraries/qtopia
Make [1]: Entering directory '/friendly-arm/x86-qtopia/qtopia/src/libraries/qtopia'
Make [1]: Nothing to be done for 'default '.
Make [1]: Leaving directory '/friendly-arm/x86-qtopia/qtopia/src/libraries/qtopia'
Make-C 3 rdparty/libraries/FreeType
Make [1]: Entering directory '/friendly-arm/x86-qtopia/qtopia/src/3 rdparty/libraries/FreeType'
Make [1]: Nothing to be done for 'default '.
Make [1]: Leaving directory '/friendly-arm/x86-qtopia/qtopia/src/3 rdparty/libraries/FreeType'
Make-C libraries/qtopia1
Make [1]: Entering directory '/friendly-arm/x86-qtopia/qtopia/src/libraries/qtopia1'
G ++-c-I/friendly-arm/x86-qtopia/qtopia/include-I/friendly-arm/x86-qtopia/QT/include-pipe-dqws-fno-tions-fno- rtti-O2-wall-w-dno_debug-FPIC-dqtopia_app_interface-I. MOC/Linux-generic-G ++/-I/friendly-arm/x86-qtopia/qtopia/src/Server-o. OBJ/Linux-generic-G ++ // global1.o global1.cpp
Global1.cpp: 39: 23: UUID/UUID. H: No file or directory
Global1.cpp: In static member function 'static quuid Global: generateuuid ()':
Global1.cpp: 188: ': uuid_generate' undeclared (first use here)
Make [1]: *** [. OBJ/Linux-generic-G ++ // global1.o] Error 1
Make [1]: Leaving directory '/friendly-arm/x86-qtopia/qtopia/src/libraries/qtopia1'
Make: *** [libraries/qtopia1] Error 2

  This is because you did not correctly install RedHat 9.0. Please refer to the article "fully install RedHat 9.0 step by step" to correctly install your RedHat 9.0 System
   
  (2)Errors during compilation of Hello
  The information is as follows:
  /Usr/lib/qt-3.1/bin/UIC hello_base.ui-o./hello_base.h
G ++-c-I/include-I/usr/lib/qt-3.1/include-pipe-dqws-fno-tions-fno-rtti-O2-wall-w-dno_debug- dqtopia_app_interface-I. MOC/Linux-generic-G ++/-o. OBJ/Linux-generic-G ++ // hello. O hello. CPP
G ++-c-I/include-I/usr/lib/qt-3.1/include-pipe-dqws-fno-tions-fno-rtti-O2-wall-w-dno_debug- dqtopia_app_interface-I. MOC/Linux-generic-G ++/-o. OBJ/Linux-generic-G ++ // main. O main. CPP
Main. cpp: 2: 35: qtopia/qpeapplication. h: no such file or directory
Main. cpp: In function 'int main (INT, char **)':
Main. cpp: 6: 'qpeapplication' undeclared (first use this function)
Main. cpp: 6: (each undeclared identifier is reported only once for each function
It appears in .)
Main. cpp: 6: Parse error before '('token
Main. cpp: 9: 'A' undeclared (first use this function)
Main. cpp: 5: Warning: Unused parameter 'int argc'
Main. cpp: 5: Warning: Unused parameter 'Char ** argv'
Make: *** [. OBJ/Linux-generic-G ++ // main. O] Error 1
  We can see from the error message that the-I/include header file directory is used during the compilation of Hello. This directory is incorrect, and the cause is: you have not run the ldconfig command after build!
   
  (3) The second error occurs during the compilation of Hello
  The error message is as follows:
  [Root @ localhost Hello] # Make
/Usr/lib/qt-3.1/bin/UIC hello_base.ui-o./hello_base.h
/Usr/lib/qt-3.1/bin/UIC: Error while loading Shared Library: libqt-mt.so.3: cannot open shared objectFile:No such file or directory
Make: *** [hello_base.h] Error 127
  As you can see from the error message, your x86-qtopia environment is not set up, and redhat9.0 is also used. The solution is as follows:
  Method 1: Perform the preceding steps in the same window. When the build script is run, the environment creation is included. You cannot leave the window environment where the build is run to compile hello
  Method 2: create a new environment on your own. Use the/friendly-arm/x86-qtopia/set-env script. Be sure to use". Set-env". Note that there is a space in the middle.
  Similarly, you cannot leave the window environment in which the set-env runs to compile hello

 

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.