Roughly speaking, you need to have a main () function inside one of your C ++ files that you are compiling.
As the compiler says, you just need to have the main () method inside your foo.cpp, for example:
#include "foo.h"
#include <iostream>
using namespace std;
int Multiply(const int Number)
{
return Number * 2;
}
int main() {
cout << Multiply(3) << endl;
return 0;
}
, ( main() foo.cpp, ):
main.cpp
#include "foo.h"
#include <iostream>
using namespace std;
int main() {
cout << Multiply(3) << endl;
return 0;
}
g++ main.cpp foo.cpp