Building "Hello World" using the Arm Compiler

Learn how to build a simple C program called hello_world.c with the Arm Compiler toolchain in DS-5 Development Studio.

Building "hello world" using Arm Compiler

In this tutorial, we show how to build a simple C program called hello_world.c with the Arm Compiler toolchain in DS-5.

You can find an overview of the Arm Compiler toolchain.

This tutorial assumes you have installed and licensed Arm DS-5. For more information, see Getting Started with Arm DS-5 Development Studio.

1. Create a new project

  1. Select File > New > C Project from the main menu to display the C Project dialog box.
  2. Enter the project name Hello World.
  3. Click on Finish to create the new project. The project is visible in the Project Explorer view.
  4. Right-click on the Hello World project in the Project Explorer view.
  5. Select New > Source File from the context menu to display the New Source File dialog box.
  6. Enter the file name hello_world.c.
  7. Click on Finish to create the new source file and open it in an editor. The new source file is visible in the Project Explorer view, under the Hello World project.
  8. Add the following code to the new source file, and press Ctrl+S to save:

    #include <stdio.h>
    main()
    {
        printf("Hello World");
    }

2. Configure compiler settings

  1. Select the Hello World project in the Project Explorer view.
  2. Select Project > Properties from the main menu to display the Properties dialog box.
  3. Expand C/C++ Build in the Properties dialog box.
  4. Select Settings.
  5. On the Tool Settings tab, select Arm C Compiler > Optimizations to display the optimization settings.
  6. Change "Optimization level" to High (-O2).
  7. Click OK to save the settings.

3. Build the project

  1. Right-click on the Hello World project in the Project Explorer view.
  2. Select Build Project.

The output image hello_world.axf appears in the Debug folder.

That's it. You have built your first program using Arm Compiler.

Further reading