Windows下使用Eclipse交叉编译ARM
2014-11-10 16:38
323 查看
原文:http://www.acmesystems.it/foxg20_eclipse_windows_c
先转过来,有时间再翻译。
Developing in C/C++ with Eclipse Indigo on Windows
This article illustrates how to use Eclipse Indigo IDE to cross compiling your C/C++ code on a Windows PC and run it on a FOX Board G20.Eclipse is a multi-language software development environment comprising an IDE and a plug-in system to extend it. It is written primarily in Java and can be used to develop applications
in Java and, by means of the various plug-ins, in other languages as well, including C, C++, Python, Perl, PHP, and others (read
more...).
Install Eclipse Indigo
Download Eclipse IDE for C/C++ Developers for Windows from the Eclipse website:Eclipse IDE for C/C++ Developers
Uncompress the ZIP file directly in the working directory (i.e. c:\eclipse) and execute eclipse.exe to run Eclipse on your desktop.
The welcome screen will appear:
Install the ARM plugins
To make the cross compilation procedure simple, install a plugin called GNU ARM Eclipse Plug-in.Open the install form selecting the "Help –> Install New Software…" menu item then copy in the "Work with:" field this URL: "http://gnuarmeclipse.sourceforge.net/updates".
Uncheck the "Group items by category" to display the ARM plugins available.
Check the GNU ARM C/C++ Development Support item and press the Next button.
Sourcery CodeBench Lite 2011.09-70 for ARM GNU/Linux
Sourcery CodeBench Lite 2011.09-70 for ARM GNU/Linux is a complete C/C++ development environment based on the GNU Toolchain which is freely available and has a quick installer thatalso manages the path variables to simplify the calls to the executable everywhere inside your computer.
Go to https://sourcery.mentor.com/sgpp/lite/arm/portal/release2029 and
download the IA32 Windows Installer version (about 127MB).
Run the executable file to install it and select the Typical installation.
When the message box "Chose Install Folder" appears, type a simple path like c:\codesourcery avoid using the default path. On my Windows XP for example the default
path is C:\Program Files\CodeSourcery\Sourcery_CodeBench_Lite_for_ARM_GNU_Linux that Eclipse will probably not manage.
The last step to carry out is to remove the part "linux-gnu" in the filename of some executable files located in c:\codesourcery\bin.
For example arm-none-linux-gnueabi-gcc.exe must become arm-none-eabi-gcc.exe used by default by the Eclipse ARM plugin.
List of renaming to do:
Original name | New name |
---|---|
arm-none-linux-gnueabi-gcc.exe | arm-none-eabi-gcc.exe |
arm-none-linux-gnueabi-gdb.exe | arm-none-eabi-gdb.exe |
arm-none-linux-gnueabi-ld.exe | arm-none-eabi-ld.exe |
arm-none-linux-gnueabi-objcopy.exe | arm-none-eabi-objcopy.exe |
arm-none-linux-gnueabi-objdump.exe | arm-none-eabi-objdump.exe |
arm-none-linux-gnueabi-size.exe | arm-none-eabi-size.exe |
Create your first project
Create a new C Project in Eclipse starting from the menu:File | +- New +- C Project
Insert your project name (for example hello) and select the toolchains ARM Windows GCC (Sourcery G++ Lite) then press the Next button.
On the next form press Advanced setting... button.
The project properties form will appear.
Set:
C/C++ Build | +- Settings. Tab: Tool Settings: | | | +- Target processor: arm962ej-s | +- Thumb (-mthumb): checked +- Debugging | | | +- Debug format: Toolchain default +- Additional tools | | | +- Create Flash Image: unchecked +- AARM Sourcery Windows GCC C Linker | +- Do not use standard start files: unchecked
Type the OK button and Finish button to save and continue.
Create a new source file:
Menu | +- File +- Source File
and call it for example hello.c then fill it with the classic Hello World ! example listed below:
#include "stdio.h" int main(void) { printf("Hello world !\n"); return 0; }
Compile the source selecting Project -> Build project
Run on the FOX Board G20
After a build, you will obtain a file called hello.elf. Copy this file on the FOX Board G20 and set it as executable with the command:debarm:~# chmod +x hello.elf
The run it:
debarm:~# ./hello.elf Hello world !
Related links
Sourcery CodeBench Lite EditionGNU ARM Eclipse Plug-in web site
Credits
Thanks to Andrea Leganza for the original contents of this article.相关文章推荐
- 手工从零开始建立ARM交叉编译工具链,并使用Eclipse+J-Link ARM-OB STM32调试S5PV210
- 在windows环境下,使用Eclipse和gcc-Linaro工具链,对BeagleBone进行交叉编译和远程部署
- eclipse在windows下的arm交叉编译环境搭建
- 【ARM】Ubuntu下使用eclipse创建交叉编译项目
- 在windows环境下,使用Eclipse和gcc-Linaro工具链,对BeagleBone进行交叉编译和远程部署
- Eclipse-CDT Android-Native交叉编译环境配置(Windows)
- arm-linux-gcc-4.4.3交叉编译google的protobuf。以及使用方法
- 在windows下使用eclipse for c++来编译c/c++
- 在linux下使用crosstool-0.43制作自己的arm交叉编译环境 (转)
- 交叉编译环境的建立与Eclipse的使用
- QTcreator能在windows中交叉编译arm平台程序吗?
- 2.使用crosstool制作ARM-Linux交叉编译工具链
- Windows+cygwin下构造arm-linux交叉编译环境最简单的方法
- Ubuntu9.10下基于eclipse搭建arm-linux交叉编译环境
- Windows+cygwin下构造arm-linux交叉编译环境最简单的方法
- 在Windows下利用CYGWIN建立ARM交叉编译环境
- 在windows下利用cygwin+Eclipse+NDK构建交叉编译环境攻略
- windows下使用MinGW+msys编译ffmpeg,以及如何加入eclipse CDT调试
- windows下eclipse中,涉及源码编译的apk开发使用系统签名机制
- Linux中用Eclipse来开发C语言程序,交叉编译ARM嵌入式C语言