I have a very simple question. I am trying to link the following 2 files, but I get an error saying "multiple definition of function()"
In a.cpp
int function(){
return 1;
}
In main.cpp
#include "a.cpp"
int main(){
return 0;
}
I know I can fix the error by making a header file for a.cpp, or putting function() inside a class, but I'm wondering what is causing this error, since I only defined function() once. Thanks.