[Preface: it was also the first time that I set up this environment. It took more than a week and I thought it was too troublesome to configure environment variables in java, but it was just a few minutes, later, I configured php manually for at most half a day. I usually spent one day, but I am stupid. Now I have configured an embedded qt environment for more than a week, the whole person is really crazy, and at this moment, I am not sure whether my environment has been configured completely correctly. The following are some problems encountered during the environment building process, I have sorted it out a little. We recommend that you add more
[Preface: it was also the first time that I set up this environment. It took more than a week and I thought it was too troublesome to configure environment variables in java, but it was just a few minutes, later, I configured php manually for at most half a day. I usually spent one day, but I am stupid. Now I have configured an embedded qt environment for more than a week, the whole person is really crazy, and at this moment, I am not sure whether my environment has been configured completely correctly. The following are some problems encountered during the environment building process, I have sorted it out a little. It is recommended that you read a few articles about the complete environment and prepare the preliminary work (many compilation-related software packages are installed in advance) When configuring the environment ), compare and try again. If something goes wrong, go to Baidu or Google to find the answer. Don't worry. It's not too long for a week (often wrong, start from scratch )]
First, go to the QT official website (http://qt.nokia.com/downloads) download file: direct download
Qt SDK for Linux/X11 32-bit ** (422 MB) (this is relatively simple, although it may occupy a larger space)
2. Step 2 is to install the downloaded binary file:
Chmod u + x qt-sdk-linux-x86-opensource-2010.05.1.bin
./Qt-sdk-linux-x86-opensource-2010.05.1.bin (this step should be noted that gcc, g ++ has been installed, and the version is high enough because I started out in the Red Hat9 System
After installation, we found that the gcc version of red hat was too low, which caused a lot of trouble and it was not solved)
3. Download The coss tools package:
Http://kegel.com/crosstool/crosstool-0.43.tar.gz
4. Install cross tools
Mkdir ~ /Downloads creates a download folder in the user's home directory. All packages downloaded during installation will
Automatically put in this folder
Sudo apt-get install bison
Sudo apt-get install flex
The following four steps are required. The gcc version cannot be too high or too low. It can only be 3.4, because this version is used to compile the kernel.
Sudo apt-get install gcc-3.4
Cd/usr/bin
Sudo ln-s gcc-3.4 gcc
Sudo rm gcc
Formal Installation
Sudo mkdir/opt/crosstool
Sudo chown user name currently logged on/opt/crosstool
Tar-zxvf crosstool-0.43.tar.gz
Cd crosstool-0.43
Vi demo-arm.sh
Comment out # eval 'cat arm. dat gcc-4.1.0-glibc-2.3.2-tls.dat 'sh all. sh -- notest
After that, add the eval 'cat arm. dat gcc-4.1.1-glibc-2.3.2.dat 'sh all. sh -- notest
Note: cat arm. dat gcc-4.1.1-glibc-2.3.2.dat instead of the default gcc-4.1.1-glibc-2.3.6-tls.dat
Modify the Linux kernel version, Linux kernel can be selected by yourself, my Linux kernel is linux-2.6.24 (the one downloaded earlier)
Lingd @ Ubuntu :~ /Downloads/crosstool-0.43 $ vi gcc-4.1.1-glibc-2.3.2.dat
BINUTILS_DIR = binutils-2.16.1
GCC_CORE_DIR = gcc-3.3.6
GCC_DIR = gcc-4.1.1
GLIBC_DIR = glibc-2.3.2
LINUX_DIR = linux-2.6.28
LINUX_SANITIZED_HEADER_DIR = linux-libc-headers-2.6.12.0
GLIBCTHREADS_FILENAME = glibc-linuxthreads-2.3.2
GDB_DIR = gdb-6.5
Modify the prefix of the Cross-compilation tool
Vi arm. dat
KERNELCONFIG = 'pwd'/arm. config
TARGET = arm-linux(This name is the target name. I think the default value (arm-unknow-linux-gnu) is too long, so I modified it. After the modification, I should pay attention to the permission of the relevant directory)
TARGET_CFLAGS = "-O"
Run the following command to compile and download the following package:
Binutils-2.16.1
Gcc-3.3.6
Gcc-4.1.1
Glibc-2.3.2
Linux-2.6.24
Linux-libc-headers-2.6.12.0
Glibc-linuxthreads-2.3.2
Gdb-6.5
This project takes n hours.
You can take a look at the files in the ls, which contain some script files. For specific functions, visit http://kegel.com/crosstoolto refer to FAQs.
/Demo-arm.sh(It will take a long time)
After the execution, the last line prompts:
Done!
After the execution is completed, modify the environment variable
After the installation is complete, the default installation directory is the/opt/crosstools/
1. Add Environment Variables
Vi ~ /. Bashrc
Add the following
If [-d/opt/crosstool/gcc-4.1.1-glibc-2.3.2/arm-linux]; then
PATH =/opt/crosstool/gcc-4.1.1-glibc-2.3.2/arm-linux/bin: $ PATH
Fi
Add the bin directory of the installed tool to the PATH variable.
Save
2. source ~ /. Bashrc to make the environment variable take effect
$Source ~ /. Bashrc
3. Restart the terminal.
After entering the arm, press the table key twice in a row to see the arm-linux-gcc-4.1.1, indicating that the installation was successful
$ Arm
Arm2hpdl arm-linux-gcc arm-linux-objdump
Arm-linux-addr2line arm-linux-gcc-4.1.1 arm-linux-ranlib
Arm-linux-ar arm-linux-gccbug arm-linux-readelf
Arm-linux-as arm-linux-gcov arm-linux-size
Arm-linux-c ++ arm-linux-gprof arm-linux-strings
Arm-linux-c ++ filt arm-linux-ld arm-linux-strip
Arm-linux-cpp arm-linux-nm
Arm-linux-g ++ arm-linux-objcopy
$ Arm
========================================================== ======================================
Possible problems:
1.The following error occurs when crosstool runs in ubuntu: getandpatch. sh: 1: patch: not found.
1. Execute apt-get update
2. apt-get install patch
2. the gcc version is too low or too high. My ubuntu version is 10.10 and the gcc version is 4.4.6. Another 3.4 installation is required. The software package may not be found when running commands, all software sources (9.04; third parties) need to be checked in the Software Center.
========================================================== ======================================