In this section, you will configure the Eclipse IDE for cross-compilation and learn how to use it to deploy your application to the target.

Information provided in this section was based on the Linux SDKs and the Hello World application on Embedded Linux articles from Toradex' knowledge-base. Notice that even though the latter uses the Linaro toolchain, the concepts presented can be applied when using the OpenEmbedded SDK as well.

In this module you will:

Download and install the latest Eclipse IDE for C/C++ developers

Configure a C project for cross-compilation using the provided Software Development Kit (SDK)

Cross-compile a hello-world application

Note: This guide provides information for the Eclipse Neon 3 release. Other releases than Neon may require extra steps to be followed which are not covered in this guide.

In the Other flags field, replace the contents with the variable "${CFLAGS} -c", as presented below:

${CFLAGS} -c

See the image for reference:

Setting the Other Flags to use variable from Cross Compiler Enviroment

Note: The current level of compiler optimization set in CFLAGS (-O2) might impair debug to some extent. If you have trouble debugging applications of your own, you may try substituting '${CFLAGS} -c' to '-Og -pipe -g -feliminate-unused-debug-types -c'

For projects with specific flags, you may want to set the parameters directly in the Eclipse IDE instead of using the variables exported by the setup script. For that, please see the question How can I directly set the compiler flags in the Eclipse IDE from this FAQ.

This tutorial was tested for the Eclipse Neon release, using the Eclipse IDE for C/C++ developers. You can try any version you want, although steps may vary from the ones presented in this guide. Consult the Eclipse website for information about new releases and features.