Hello all.
I just have a simple question. How do I compile a function library to be accessed dinamically?
Let's say I have these 3 files:
main.c
Code:
#include "mylib.h"
int main( void )
{
int a = 2;
int b = 3;
sum( a, b );
div( a, b );
return 0;
}
mylib.c
Code:
#include "mylib.h"
void sum( int a, int b )
{
a + b;
return;
}
void div( int a, int b )
{
if ( b != 0 )
a / b;
return;
}
mylib.h
Code:
void sum( int, int );
void div( int, int );
What would the gcc command look like if I just wished the library to be dinamically linked.
Thanks in advance !