I am executing a C++ program on my Xcode 6.2, but I am getting this error : 

```
Undefined symbols for architecture x86_64:
  "operator+(Stack1<int> const&, Stack1<int> const&)", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

```

I am not sure how to go ahead in resolving this issue, I checked few others on Stackoverflow.com but could not resolve my issue ,

```
#include <iostream>
#include <vector>

using namespace std;

template <class T>
class Stack1;

template <class T>
Stack1<T> & operator+(const Stack1<T> &x, const Stack1<T> &y) {
Stack1<T> z = x;
for (unsigned int i=x.size(); i<(x.size()+y.size()); i++) {
    z.push(y[i]);
}
return z;
}

template <class T>
class Stack1 {
friend Stack1<T> & operator+(const Stack1<T> &x, const Stack1<T> &y);
private: vector <T> elems;
public: bool empty();
void push(const T &item);
T & top();
void pop();
long size();
};

template <class T>
bool Stack1<T>::empty() {
return elems.empty();
}

template <class T>
void Stack1<T>::push(const T &item){
elems.push_back(item);
}

template <class T>
T &Stack1<T>::top(){
   return elems.back();
}

template <class T>
void Stack1<T>::pop() {
if (!elems.empty())
    return elems.pop_back();
}

template <class T>
long Stack1<T>::size() {
return elems.size();
}

int main(int argc, const char * argv[]) {
Stack1 <int> intStack;
Stack1 <float> floatStack;
Stack1 <string> stringStack;
Stack1 <int> a;
Stack1 <int> b;

intStack.push(7);
intStack.push(3);
intStack.push(0);
intStack.push(8);

floatStack.push(0.9);
floatStack.push(4.78);
floatStack.push(2.157);

stringStack.push("test1");
stringStack.push("abc");

while (!intStack.empty()) {
    cout << "Popping from intStack: " << intStack.top() << endl;
    intStack.pop();
}

if (intStack.empty()) {
    cout << "intStack is empty" << endl;
}

while (!floatStack.empty()) {
    cout << "Popping from intStack: " << floatStack.top() << endl;
    floatStack.pop();
}

if (floatStack.empty()) {
    cout << "floatStack is empty" << endl;
}

while (!stringStack.empty()) {
    cout << "Popping from intStack: " << stringStack.top() << endl;
    stringStack.pop();
}

if (stringStack.empty()) {
    cout << "stringStack is empty" << endl;
}

for (int i=0; i<3; i++) {
    a.push(i);
}
for (int i=9; i>5; i--) {
    b.push(i);
}
 //  cout << "Size of a:" << a.size();
Stack1 <int> c;
c = a+b;

while (!c.empty()) {
    cout << "Popping from c: " << c.top() << endl;
    c.pop();
}

return 0;
}

```

Get this error: 

```
  error: failed to launch '/Users/User-name/Library/Developer/Xcode/DerivedData/4_TemplatedStack-bmcfhzdrgyhhybajmxvpyuypgmag/Build/Products/Debug/4_TemplatedStack'

```