ARM assembly--ubuntu12.04 Installation Arm-linux cross-compilation environment

Source: Internet
Author: User

1. Install the standard C development environment, because Ubuntu installation is not installed by default, so you need to install it first:
sudo apt-get install gcc g++ libgcc1 libg++ make GDB

2. Download the latest version of the cross compiler from ftp://ftp.arm.linux.org.uk/pub/armlinux/toolchain/, I downloaded the cross-3.2.tar.bz2, extracted to the Downloan directory, will generate home /downloads/usr/local/arm/, and then sudo cp-r arm/usr/local/arm/

3. Add the path to the cross-compiler

sudo vi/etc/bash.bashrc
Add the following code later:
if [-d/usr/local/arm]; Then
Path=/usr/local/arm/bin: "${path}"
Fi


4. Make the new environment variable effective

# Source/etc/profile

5. Check to see if the path is joined to path:

Echo $PATH
If there is/usr/local/arm/bin in the displayed content, the path of the cross-compiler has been added
Since then, the cross-compilation environment has been installed.

6. Test Example:

Code HELLO.C

#include <stdio.h>int main () {printf ("Ubuntu, I Am linux-arm-toolchain\n");}

The terminal enters the directory where the HELLO.C is located and executes:

ARM-LINUX-GCC Hello.c-o Hello

Compilation succeeded.

The problem encountered:

Copy a relatively simple code from the Web, compile with the following issues:

Test_getopt.c:9:35:error:stray ' \342 ' in program
Test_getopt.c:9:35:error:stray ' \200 ' in program
Test_getopt.c:9:35:error:stray ' \235 ' in program
Test_getopt.c:12:3: Error:stray ' \342 ' in program
Test_getopt.c:12:3: Error:stray ' \200 ' in program
Test_getopt.c:12:3: Error:stray ' \230 ' in program
Test_getopt.c:12:3: Error:stray ' \342 ' in program
Test_getopt.c:12:3: Error:stray ' \200 ' in program
Test_getopt.c:12:3: Error:stray ' \231 ' in program
Test_getopt.c:13:4: Error:stray ' \342 ' in program
Test_getopt.c:13:4: Error:stray ' \200 ' in program

Say, this problem occurs because the source code in the presence of Chinese characters, such as ",", and so on, it can be changed!

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.