+1  A: 

You're not properly linking in overload.cpp. Make sure that overload.cpp is party of your project file in both cases.

Adam Rosenfield
@AdamRosenfield could you be more specific about how to do this, I added each of the files to the Xcode project before I tried building the files and the files show up in the project window of Xcode, so I am not sure what you mean.
Jordan
@Jordan: This was an attempt at psychic debugging, apparently my psychic powers were off today. Can you please post the entirety of the code for overload.cpp and overload.h?
Adam Rosenfield
@Jordan: You can check if `overload.cpp` is included in the build by going to *"Targets"* -> your target. There check if its included in the *"Compile Sources"* folder.
Georg Fritzsche
@Georg all the .cpp files are there
Jordan
+1  A: 

The error undefined symbol is a linker error. It means that when you are linking all your code into a single executable / library, the linker is not able to find the definition of the function. The main two reasons for that are forgetting to include the compiled object in the library/executable or an error while defining the function (say that you declare void f( int & ); but you implement void f( const int & ) {}).

I don't know your IDEs (I have never really understood Xcode) but you can try to compile from the command line: g++ -o exe input1.cpp input2.cpp input3.cpp ...

David Rodríguez - dribeas
@David I gave it a try `g++ -o exe overload.cpp overloadtester.cpp` but not luck a very similar error was coming up relating to symbols not found
Jordan
@David: In the end I was missing a `const` reference from the code, thanks for your help.
Jordan
Georg Fritzsche
A: 

If overload is a template class, the source for the operator must occur in the header.

In addition, the names must be fully qualified. That is, if you have any namespace/class static members, they must have the full definition applied to them when defining the member's implementation.

DeadMG
@DeadMG I am not sure what all that meant I am relatively new to the programming world. Maybe you could elaborate a little.
Jordan
A: 

You have not added the files to your project correctly so the compiler is not building it and the linker is not linking it in.

The reason I can tell is that you have posted invalid code that will not compile. Had you added it to your project, the compiler would have failed and you would never have gotten to the linking step.

In Visual Studio, you can add an existing file to your project in the Project menu under Add Existing Item...

R Samuel Klatchko