I'm new to programming, and I'm currently working on a project that got a little too big to keep in a single cpp file, so I decided to split it up into its constituent parts in different cpp files.
The project has 3 cpp files;
main.cpp, TwinCameraCapture.cpp, FaceCalibration.cpp,
All of the meat of the code is in FaceCalibration.cpp and TwinCameraCapture.cpp, with main.cpp looking like this:
#include "FaceCalibration.cpp"
#include "TwinCamCapture.cpp"
int main ()
{
FaceCalibration();
TwinCameraCapture();
}
With FaceCalibration and TwinCameraCapture being the primary functions within their respective .cpp files.
Now, I know I'm doing something wrong here, I just don't know what exactly it is. The error I get when trying to compile is:
Apple Mach-O Linker (Id) Error
Command /Developer/usr/bin/llvm-g++-4.2 failed with exit code 1
Could someone please explain what I've done wrong and how to fix it, or point me to a guide that will do so?
Thanks
EDIT: The full error message is:
ld: duplicate symbol getWindow(cv::Rect_<int>) in
/Users/facebooth/Library/Developer/Xcode/DerivedData/FullProgramTest-
awrdeznffntuoacjytwewfbjdmza/Build/Intermediates/FullProgramTest.build/Debug/FullProgramTest.build/Objects-normal/x86_64/FaceCalibration.o and
/Users/facebooth/Library/Developer/Xcode/DerivedData/FullProgramTest-
awrdeznffntuoacjytwewfbjdmza/Build/Intermediates/FullProgramTest.build/Debug/FullProgramTest.build/Objects-normal/x86_64/main.o for architecture x86_64
Command /Developer/usr/bin/llvm-g++-4.2 failed with exit code 1