January 2018
Intermediate to advanced
456 pages
12h 49m
English
We will build a static library, libhelloworld, from two source files, hello.c and world.c, and use it to build a hello world application. The source files for the library are presented here. The following is the code for the hello.c file:
char * hello (void)
{
return "Hello";
}
This is the code for the world.c file:
char * world (void)
{
return "World";
}
To build the library, follow these steps:
$ source /opt/poky/2.4/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
$ ${CC} -c hello.c world.c$ ${AR} -cvq libhelloworld.a hello.o world.o
$ ${AR} -t libhelloworld.a
The application source code is presented ...
Read now
Unlock full access