board/beaglebone Black

Using Eclipse to Cross-compile Applications for Embedded Systems 3

멋진 고파 2013. 9. 5. 00:41

from : http://www.lvr.com/eclipse3.htm

Part 3: Create and Configure a Project

With Eclipse installed, you're ready to create and configure a project.

Create a Project

Run eclipse and select File -> New -> Project

Open Project

In the New Project window, click C/C++, select C Project, and click Next

New Project

Enter your project's name (hello_world for this example) 

프로잭트 이름에 공백이 들어가면 이상한 에러가 발생한다. 이것 때문에 주노로 넘어 갈뻔..

and click Finish.

Create Project

If the Open Associated Perspective window appears, click Yes.

Create a Build Configuration

The project requires defining a builld configuration that tells Eclipse how to cross-compile the project for the BeagleBoard-xM.

In the Project Explorer, right-click the project name and select Build Configurations -> Manage...

Build Configurations

Click New to create a configuration for cross-compiling.

Manage Configurations

In the Name box, enter the name of the configuration (bb_debug). Under Copy setttings from, select Existing configuration and Debug.

Create Build Configuration

Click OK and OK to return to the project.

In the Project Explorer, right-click hello_world and select Properties.

Project Properties

At the C/C++ Build item, click the arrow to expand the options and click Settings.

Project Settings

In the Configuration box, select bb_debug.

Click GCC Compiler, and set the Command text box to:

/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc

or your path to arm-angstrom-linux-gnueabi-gcc or your compiler if different.

Compiler Settings

Under GCC C Compiler, click Includes. In the Include paths (-l) window (the top one), click the icon with an arrow to add a directory path. Add:

/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include

or your path to arm-angstrom-linux-gnueabi/usr/include or your include directory if different.

Click OK.

Includes Settings

Click GCC Linker, and replace the text in the Command text box with:

/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc

or your path to arm-angstrom-linux-gnueabi-gcc or your compiler if different.

Linker Settings

Under GCC C Linker, click Libraries. In the Library search path (-L) window (the bottom one), click the icon with an arrow to add a directory path. Add:

/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/lib

or your path to arm-angstrom-linux-gnueabi/lib or your libraries if different.

Library Path

Click OK.

Click GCC Assembler and replace the text in the Command text box with:

/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-as

or your path to arm-angstrom-linux-gnueabi-as or your assembler if different.

Assembler Settings

Click OK.

In the Project Explorer, right-click the project name and select Build Configurations -> Set Active and select bb_debug or whatever you named your build configuration.

Set Configuration

Go to Part 4: Compile and Run an Application.