Here are 2 simple files I am unsucessfully trying to combine and make the .exe. The errors i get are: Multiple definition of '_fun1' and '_fun2'.
I am using the Cygwin gcc compiler. Please advice, Thanks.
#include <stdio.h>
#include "functions.c"
int i = 35;
int fun1();
int fun2();
int main()
{
printf ("\n %d", i);
fun1();
fun2();
return 0;
}
/* functions.c */
#include <stdio.h>
extern int i;
int fun1()
{
i++;
printf ("\n %d", i);
return 0;
}
int fun2()
{
i--;
printf ("\n %d", i);
return 0;
}