1. Install the standard C development environment, because the Linux installation is not installed by default, so you need to install it first (if it is already installed, you can avoid this step): # Sudo apt-get install gcc g++ libgcc1 libg++ make gdb
2. Download arm-linux-gcc-3.4.1.tar.bz2 to any directory, I downloaded it to my personal folder The download address of /home/wrq arm-linux-gcc-3.4.1.tar.bz2 is as follows:
3. Unzip arm-linux-gcc-3.4.1.tar.bz2 #tar -jxvf arm- Linux-gcc-3.4.1.tar.bz2 The decompression process takes a while, the unzipped file forms the usr/local/folder, enters the folder, and copies the arm folder to /usr/local/# cd usr /local/#cp -rv arm /usr/local/Now the cross-compiled assembly is under /usr/local/arm/3.4.1/bin
4. Modify the environment variable and put the cross compiler The path is added to the PATH. (There are three methods, it is strongly recommended to use method one) Method 1: Modify the /etc/bash.bashrc file #vim /etc/bash.bashrc At the end add: export PATH=$PATH:/usr/local/arm/3.4. 1/bin export PATH Method 2: Modify the /etc/profile file: # vim /etc/profile Increase the path setting, add the following at the end, save the /etc/profile file: export PATH=$PATH:/usr/local/arm/3.4.1/bin Method 3: #export PATH=$PATH:/usr/local/arm/3.4.1/bin Note: (This can only be valid under the current terminal!)
5. Immediately make the new environment variable take effect without restarting the computer: Corresponding method one: #source /root/.bashrc Corresponding method two: #源 /etc/profile
6. Check if the path is added to the PATH : # echo $PATH shows /usr/local/arm/bin in the content, indicating that the path of the cross compiler has been added to the PATH. At this point, the cross-compiler environment is installed. (This article address:) 7. Test whether the installation is successful # arm-linux-gcc -v The above command will display the arm-linux-gcc information and version, this is the information I displayed: Reading specs from /usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/specs Configured with: /work/crosstool-0.27/build/arm-linux/gcc-3.4.1-glibc-2.3.2/gcc- 3.4.1 /configure --target=arm-linux --host=i686-host_pc-linux-gnu
--prefix=/usr/local/arm/3.4.1 --with-headers=/usr/local /arm/3.4.1/arm
-linux/include --with-local-prefix=/usr/local/arm/3.4.1/arm-linux --disable
- Nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable- languages=c,c++ --enable-shared --enable-c99 --enable-long-long Thread model: posix Gcc version 3.4.1
8. Compile the Hello World program and test the cross toolchain. Write the following Hello World program and save it as hello.c #include <stdio.h> int main() { printf( "Hello World!\ "); return 0; } execute the following command : # arm-linux-gcc -o hello hello.c
Engaged in two years WindowsClient development, what multi-threading, multi-process development, ha
single, enter single-user mode, then change the startup mode to id:3:initdefault: in /etc/inittab (t
The Linux command line is useful, efficient, and fun, but sometimes dangerous, especially if you are
In order to ensure the normal operation of the Linux system and accurately solve various system prob
/var/lib/mysql/mysql.sock connection failed
How to modify SWAP space size under Linux
Network analysis example under Linux system
The use of regular expressions and grep commands under Linux
How to mount ntfs file system partition under linux
Linux Network Programming - socket option
Modify IP, DNS and other network configurations under Linux operating system
LINUX device driver - race, blocking, reentrant code
How to limit the execution permission of the /tmp partition
PHP install imagick extension tutorial
Remote connection in Linux SSH and VNC graphics mode
Linux Network Programming - Server and Client Information Functions
Windows7 still maintains network connection status in sleep mode
The reason why the win8.1 system computer hard disk light is always on and the solution
Win8 Academy: Do you use the mail application?
DOS commands are used in large Microsoft systems to master
Two photo viewer options appear in the Win8 right-click menu open mode.
How to solve the error code 0X80004005 in Win7 system?
Solution for unable to enable system restore function under Tomato Garden win7 system