I have spend a lot of time trying to fix this error:

```
Undefined symbols for architecture x86_64:
  "operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, SingleLinkedLists<int>&)", 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 what the problem is. I have found people having similar issues with Xcode and I tried to follow their steps but nothing seemed to work. I just updated Xcode as well but it did not fix my problem either. Here is my code:

```
#ifndef SingleLinkedLists_h
#define SingleLinkedLists_h

#include <iostream>

template <class T>
class SingleLinkedLists {
private:

    struct Node {
        T data;
        Node* next;
    };
    Node* head;
    Node* tail;

public:
    // Constructors
    SingleLinkedLists() : head(nullptr), tail(nullptr) {}
    SingleLinkedLists(SingleLinkedLists const& value);
    ~SingleLinkedLists();

    // Overloaded operators
    SingleLinkedLists& operator=(SingleLinkedLists const& rhs);
    friend std::ostream& operator<<(std::ostream& str, SingleLinkedLists& data);

    // Operators in Single Linked List
    void swap(SingleLinkedLists& other) noexcept;
    void createNode(const T& theData);
    void createNode(T&& theData);
    void display() const;
    void insertHead(const T& theData);
    void insertPosition(int pos, const T& theData);
    void deleteHead();
    void deleteTail();
    void deletePosition(int pos);
    bool search(const T& x);
};

template <class T>
SingleLinkedLists<T>::SingleLinkedLists(SingleLinkedLists const& value) : head(nullptr), tail(nullptr) {
    for(Node* loop = value->head; loop != nullptr; loop = loop->next) {
        createNode(loop->data);
    }
}

template <class T>
SingleLinkedLists<T>::~SingleLinkedLists() {
    while(head != nullptr)
        deleteHead();
}

template <class T>
SingleLinkedLists<T>& SingleLinkedLists<T>::operator=(SingleLinkedLists const& rhs) {
    SingleLinkedLists copy(rhs);
    swap(copy);
}

template <class T>
std::ostream&  operator<<(std::ostream& str, SingleLinkedLists<T>& data) {
    data.display(str);
    return str;
}

template <class T>
void SingleLinkedLists<T>::swap(SingleLinkedLists& other) noexcept {
    using std::swap;
    swap(head, other.head);
    swap(tail, other.tail);
}

template <class T>
void SingleLinkedLists<T>::createNode(const T& theData) {
    Node* temp = new Node;
    temp->data = theData;
    temp->next = nullptr;

    if(head != nullptr) {
        temp = head;
        temp = tail;
        temp = nullptr;
    }
    else {
        temp->next = tail;
        temp = tail;
    }
}

template <class T>
void SingleLinkedLists<T>::createNode(T&& theData) {
    Node* temp = new Node;
    temp->data = std::move(theData);
    temp->next = nullptr;

    if(head != nullptr) {
        temp = head;
        temp = tail;
        temp = nullptr;
    }
    else {
        temp->next = tail;
        temp = tail;
    }
}

template <class T>
void SingleLinkedLists<T>::display() const {
    for(Node* loop = head; head != nullptr; loop = loop->next) {
        std::cout << loop->data << "\t";
    }
}

template <class T>
void SingleLinkedLists<T>::insertHead(const T &theData) {
    Node* temp = new Node;
    temp->data = theData;
    temp->next = head;
    head = temp;
}

template <class T>
void SingleLinkedLists<T>::deleteHead() {
    Node* old = head;
    head = head->next;
    delete old;
}

#endif /* SingleLinkedLists_h */

```

Here is the main.cpp file:

```
#include <iostream>
#include "SingleLinkedLists.h"

int main(int argc, const char * argv[]) {

    SingleLinkedLists<int> obj;
    obj.createNode(2);
    obj.createNode(4);
    obj.createNode(6);
    obj.createNode(8);
    obj.createNode(10);
    std::cout<<"\n--------------------------------------------------\n";
    std::cout<<"---------------Displaying All nodes---------------";
    std::cout<<"\n--------------------------------------------------\n";
    std::cout << obj << std::endl;

//    std::cout<<"\n--------------------------------------------------\n";
//    std::cout<<"-----------------Inserting At End-----------------";
//    std::cout<<"\n--------------------------------------------------\n";
//    obj.createNode(55);
//    std::cout << obj << std::endl;
//    
//    std::cout<<"\n--------------------------------------------------\n";
//    std::cout<<"----------------Inserting At Start----------------";
//    std::cout<<"\n--------------------------------------------------\n";
//    obj.insert_start(50);
//    std::cout << obj << std::endl;
//    
//    std::cout<<"\n--------------------------------------------------\n";
//    std::cout<<"-------------Inserting At Particular--------------";
//    std::cout<<"\n--------------------------------------------------\n";
//    obj.insert_position(5,60);
//    std::cout << obj << std::endl;
//    
//    std::cout<<"\n--------------------------------------------------\n";
//    std::cout<<"----------------Deleting At Start-----------------";
//    std::cout<<"\n--------------------------------------------------\n";
//    obj.delete_first();
//    std::cout << obj << std::endl;
//    
//    std::cout<<"\n--------------------------------------------------\n";
//    std::cout<<"----------------Deleting At End-----------------";
//    std::cout<<"\n--------------------------------------------------\n";
//    obj.delete_last();
//    std::cout << obj << std::endl;
//    
//    
//    std::cout<<"\n--------------------------------------------------\n";
//    std::cout<<"--------------Deleting At Particular--------------";
//    std::cout<<"\n--------------------------------------------------\n";
//    obj.delete_position(4);
//    std::cout << obj << std::endl;
//    std::cout << std::endl;
//    
//    obj.search(8) ? std::cout << "Yes" << std::endl : std::cout << "No" << std::endl;

    return 0;
}

```