Подскажите, пожалуйста, что нужно изменить, чтоб убрать данную ошибку?

user.h

class user
{
public:
    void new_table(vector <table*> &t);
};

user.cpp
void user::new_table(vector<table*> &t)
{

    t.push_back(new order());
    int code=-1;
    int i = 0;
    while (code != 0)
    {
        cout << "Enter the code of dish -> ";
        cin >> code;
        if (code == 1)
        {
            t.push_back(new latte(t[i])); 
            
            i++;
        }
        if (code == 2)
        {
            t.push_back(new coffee(t[i]));
            i++;
            
            
        }
        if (code ==3)
        {
            t.push_back(new discount(t[i]));
            i++;
        }
    }
}


source
#include "dishes.h"  //подключение классов из паттерна Декоратор
#include "user.h"
using namespace std;

int main()
{
vector <table*> tables;
user a;
a.new_table(tables);
cout << tables[tables.size() - 1]->add_dish();
}

Вот, что выдает VS:

error LNK2019: unresolved external symbol "public: void __thiscall user::new_table(class std::vector<class table *,class std::allocator<class table *> > &)";

Я не могу понять, в чем заключается ошибка. Объясните, пожалуйста. Мучаюсь с этой ошибкой второй день, смотрел в интернете, причины появления данной ошибки все равно не удалось исправить.


Ответы (0 шт):