Sample Programs

Sourcery G++ comes with some simple applications. You can import the sample programs into an IDE project.

Start by following the steps described in the section called “Building Applications”. Call the project sample, and do not create a new source file.

Figure 5.11. Importing a Source File

Importing a Source File
Click Finish to import the selected file.

At this point, the sample project exists, but there is no associated source code. The next step is to import a file from the example directory. Right-click on the sample project, and select Import.... Select GeneralFile System, and click Next. Click on Browse... beside the From directory: edit box. Navigate to the Sourcery G++ install directory and then to share/sourceryg++-arm-none-symbianelf-examples/fibonacci, and click Ok. Click the checkbox beside main.c and fib.c, then click Finish.

The “Managed Make C project” compiles automatically. Your sample program is now ready to execute or debug. Please refer to the section called “Debugging Applications” for instructions on how to debug the target application.