Suppose there are two files :
1) a.c
Code:
#include<stdio.h>
extern int func(int);
int main()
{
     int x;
     x=5;
     x=func(x);
     printf("%d",x);
     return 0;
}
2) b.c
Code:
int func(int n)
{
     return n+n;
}
After that I compile them separately...but not link them..(with the -c flag into a.o and b.o)
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')..