Difference between revisions of "User:Pau pajuelo"
From IGEP - ISEE Wiki
(→Hello world compiled with ECLIPSE) |
|||
Line 1: | Line 1: | ||
− | = Write your first C Program using | + | = Write your first C Program using Eclipse IDE = |
== Overview == | == Overview == | ||
− | + | Eclipse IDE is a software development environtment, this software package is very popular because you can extend its functionalities using pluggins. C applications can be compiled in Eclipse using Autoconf tools or Makefile. Autoconf tools can be useful if you want to develop a huge application with a lot of software dependencies, but this method can be tedious if you want to develop a simple application. | |
− | At IGEP v3.0 VM, | + | At IGEP v3.0 VM, Eclipse includes Linux tools and Yocto plugin to develop C applications for IGEP firmware as quickly and easily as possible. |
== Pre-requisites == | == Pre-requisites == | ||
Line 12: | Line 12: | ||
*VMware or VirtualBox virtualization software | *VMware or VirtualBox virtualization software | ||
− | *IGEP SDK v3.0 Virtual Machine RC2 with | + | *IGEP SDK v3.0 Virtual Machine RC2 with Eclipse IDE<br> |
*IGEP BOARD with Ethernet communication (for example IGEPv2)<br> | *IGEP BOARD with Ethernet communication (for example IGEPv2)<br> | ||
*MANUAL IGEP SDK v3.0 VM<br> | *MANUAL IGEP SDK v3.0 VM<br> | ||
Line 24: | Line 24: | ||
*Prepare your Rootfs in your Micro SD Card | *Prepare your Rootfs in your Micro SD Card | ||
*Connect to your IGEP Board using Ethernet Commnication | *Connect to your IGEP Board using Ethernet Commnication | ||
− | *Build programs using | + | *Build programs using Eclipse IDE |
− | == Hello world compiled with | + | == Hello world compiled with Eclipse<br> == |
− | If you follow "Getting started chapter | + | If you follow "Getting started" chapter you have compiled some source example programs for Eclipse, these programs use Autotools to generate binary code for IGEP. Now is time to compile your Helloworld example program without using autotools. |
=== Create your new project: === | === Create your new project: === | ||
− | Open | + | Open Eclipse->File->New->C Project |
At C Project Window: | At C Project Window: |
Revision as of 10:08, 4 July 2012
Contents
Write your first C Program using Eclipse IDE
Overview
Eclipse IDE is a software development environtment, this software package is very popular because you can extend its functionalities using pluggins. C applications can be compiled in Eclipse using Autoconf tools or Makefile. Autoconf tools can be useful if you want to develop a huge application with a lot of software dependencies, but this method can be tedious if you want to develop a simple application.
At IGEP v3.0 VM, Eclipse includes Linux tools and Yocto plugin to develop C applications for IGEP firmware as quickly and easily as possible.
Pre-requisites
To follow this How-to you need:
- VMware or VirtualBox virtualization software
- IGEP SDK v3.0 Virtual Machine RC2 with Eclipse IDE
- IGEP BOARD with Ethernet communication (for example IGEPv2)
- MANUAL IGEP SDK v3.0 VM
Getting started
First at all, you should read MANUAL IGEP SDK v3.0 VM and follow the next instructions:
- Install your Virtual Machine
- Install your Virtual Machine Guest additions
- Prepare your Rootfs in your Micro SD Card
- Connect to your IGEP Board using Ethernet Commnication
- Build programs using Eclipse IDE
Hello world compiled with Eclipse
If you follow "Getting started" chapter you have compiled some source example programs for Eclipse, these programs use Autotools to generate binary code for IGEP. Now is time to compile your Helloworld example program without using autotools.
Create your new project:
Open Eclipse->File->New->C Project
At C Project Window:
Yocto Project ADT Project ->Empty Project
Insert your project name and finish. At Project explorer panel you will see your project name
Create your source files:
Go to New C/C++ Source File button and write at "Source file:" field your source file name, for example main.c. Finish the assistant and copy the next code at this file:
#include <stdio.h> int main(void) { printf("Hello world\n"); return 0; }
Save file.
Follow the instructions above and create a Source File name Makefile and copy the next code:
all: main main: main.c $(CC) -c -o main main.c clean: rm -f main main.o
Save file
CC is an environment variable that links with arm-poky-linux-gnueabi-gcc binary (IGEP SDK GCC). Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer, it is very useful to call a command that you don't know its location.
IGEP SDK Environtment variables are located at /opt/poky/1.2/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi. You can add this variables using source command and see your current environtment variables using env command
Compile your program:
Go to Project-> Build All.
Now you can Run and Debug your program.
Under construction