Suppose there are two files :
1) a.c
2) b.cCode:#include<stdio.h>
extern int func(int);
int main()
{
int x;
x=5;
x=func(x);
printf("%d",x);
return 0;
}
After that I compile them separately...but not link them..(with the -c flag into a.o and b.o)Code:int func(int n)
{
return n+n;
}
Then how do I invoke ld so that they get together into a single executable?
..(whatever I try results in an 'undefined reference to main')..