I'm trying to create a shared library out of my C program. How do I do that? I think you need the program, so here it is:
#include "defs.h"
#include "externs.h"
int CheckPrime(int K){
int J;
J = 2;
while (1) {
if (Prime[J] == 1)
if (K % J == 0) {
Prime[K] = 0;
return 0;
}
J++;
break;
}
Prime[K] = 1;
}
I've also made a Makefile, can I do it in it?:
# -----------------------------------
# ------ executable rule -----------
# -----------------------------------
app : app.o
-gcc -g app.o -o app
# ---------------------------------------------------
# ------ intermeditate object files rule (.o) -------
# ---------------------------------------------------
app.o : main.c
-gcc -g -c main.c -o app.o