Difference between revisions of "User:Pau pajuelo"

From IGEP - ISEE Wiki

Jump to: navigation, search
Line 28: Line 28:
 
= Hello world compiled with ECLIPSE<br>  =
 
= Hello world compiled with ECLIPSE<br>  =
  
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 using ECLIPSE IDE without using autotools.
+
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 using ECLIPSE IDE without using autotools.  
 +
 
 +
=== Create your new project:  ===
 +
 
 +
Open ECLIPSE-&gt;File-&gt;New-&gt;C Project
 +
 
 +
At C Project Window:
 +
 
 +
Yocto Project ADT Project -&gt;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:
 +
<pre>#include &lt;stdio.h&gt;
 +
 +
int main(void)
 +
{
 +
  printf("Hello world\n");
 +
  return 0;
 +
} </pre>
 +
Save file.
 +
 
 +
Follow the instructions above and create a Source File name Makefile and copy the next code:
 +
<pre>put code </pre>

Revision as of 19:49, 3 July 2012

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 installing pluggins. C source code applications can be compiled in ECLIPSE using Autoconf tools or a 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 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 using ECLIPSE IDE 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:

put code