Follow these steps to create and build a "Hello world" application:
- 
Create a directory called hello_world:$ mkdir hello_world
- 
Inside the hello_worlddirectory, create a file namedhello-world.c:$ cd hello_world $ touch hello-world.c
- 
Edit the hello-world.cfile with the following contents:hello-world.c#include <stdio.h> #include <unistd.h> int main(int argc, char *argv[]){ int i; for (i = 1; i <= 10; i++) { printf("%d - Hello world!\n", i); sleep(1); } return 0; }
- 
Create a makefile file inside the hello_worlddirectory:$ touch Makefile
- 
Edit the file Makefile with the following contents: MakefileBINARY := hello-world CFLAGS += -Wall -O0 .PHONY: all all: $(BINARY) $(BINARY): hello-world.o .PHONY: clean clean: -rm -f *.o $(BINARY)
- 
Before building the code, export the toolchain environment: $ . /opt/dey/4.0-r7/ccimx93-dvk/environment-setup-cortexa55-dey-linux
- 
Cross-compile the code using make. $ makeIf you are building a Qt application, run qmakebefore cross-compiling:$ qmakeThe binary file, hello-world, is generated inside the directoryhello_world.$ ls -l total 28 -rwxrwxr-x 1 user user 12084 dic 18 12:39 hello-world -rw-rw-r-- 1 user user 199 dic 18 12:39 hello-world.c -rw-rw-r-- 1 user user 4968 dic 18 12:39 hello-world.o -rw-rw-r-- 1 user user 189 dic 18 12:39 Makefile
 
         
   
   
        