I have the following scenario,
File 1: main.c
extern void afunction(int);
int main()
{
afunction(0);
}
File 2: other.cpp
void afunction()
{
// do some crazy stuff.
return;
}
How do I link those two files together so that when the compiler attempts to find afunction() it does?
Note1: I cannot use #include "other.cpp"
Note2: I don't want to create a library unless I have no other choice.
--
I have attempted the following gcc command, but it gives undefined reference.
gcc other.cpp main.c
Any ideas? Thanks!