Basic example of simple C program include static library compilation-source code
install gcc compiler:
apt-get install gcc
All following steps are done in the same directory !! NO need to have an root permissions.
create library1 and save it as liblibrary_1.c:
#include
void library_1(char *val)
{
printf(”Passed value to library_1: %s\n”, val);
}
create library2 and save it as liblibrary_2.c:
#include
void library_2(char *val)
{
printf(”Passed value to library_2: %s\n”, val);
}
Compile both c libraries source codes:
gcc -c liblibrary_1.c liblibrary_2.c
NOTE: [...]
Filed under: C, Linux, Linux Programming Tutorial, Programming | No Comments »