You copied the Doc URL to your clipboard.

Compile and run a simple 'Hello World' program

This simple example illustrates how to compile and run a simple Hello World program.

  1. Create a simple "Hello World" program and save it in a file. In our case, we have saved it in a file named hello.c.

    /* Hello World */
    #include <stdio.h>
    int main()
    {
        printf("Hello World");
        return 0;
    }
    
  2. To generate an executable binary, compile your program with Arm® C/C++ Compiler.

    armclang -o hello hello.c
    
  3. Now you can run the generated binary hello as shown below:

    ./hello
    

In the following sections we discuss the available compiler options in more detail and, towards the end of this tutorial, illustrate using them with a more advanced example.

Was this page helpful? Yes No