1>Menu.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl Queue::Pop(void)" (?Pop@?$Queue@UProcessor@@@@UEAAXXZ)
1>Menu.obj : error LNK2001: unresolved external symbol "private: virtual void __cdecl Queue::Resize(int)" (?Resize@?$Queue@UProcessor@@@@EEAAXH@Z)
1>Menu.obj : error LNK2001: unresolved external symbol "private: virtual void __cdecl Queue::Add(struct Processor const &,unsigned int)" (?Add@?$Queue@UProcessor@@@@EEAAXAEBUProcessor@@I@Z)
1>Menu.obj : error LNK2001: unresolved external symbol "private: virtual void __cdecl Queue::Remove(void)" (?Remove@?$Queue@UProcessor@@@@EEAAXXZ)
1>Menu.obj : error LNK2001: unresolved external symbol "private: virtual struct Processor const & __cdecl Queue::Show(bool)" (?Show@?$Queue@UProcessor@@@@EEAAAEBUProcessor@@_N@Z)
1>Menu.obj : error LNK2001: unresolved external symbol "private: virtual bool __cdecl Queue::IsContainerEmpty(void)const " (?IsContainerEmpty@?$Queue@UProcessor@@@@EEBA_NXZ)
1>Menu.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl PriorityQueue::Pop(void)" (?Pop@?$PriorityQueue@UProcessor@@@@UEAAXXZ)
1>Menu.obj : error LNK2001: unresolved external symbol "private: virtual void __cdecl PriorityQueue::Resize(int)" (?Resize@?$PriorityQueue@UProcessor@@@@EEAAXH@Z)
1>Menu.obj : error LNK2001: unresolved external symbol "private: virtual void __cdecl PriorityQueue::Add(struct Processor const &,unsigned int)" (?Add@?$PriorityQueue@UProcessor@@@@EEAAXAEBUProcessor@@I@Z)
1>Menu.obj : error LNK2001: unresolved external symbol "private: virtual void __cdecl PriorityQueue::Remove(void)" (?Remove@?$PriorityQueue@UProcessor@@@@EEAAXXZ)
1>Menu.obj : error LNK2001: unresolved external symbol "private: virtual struct Processor const & __cdecl PriorityQueue::Show(bool)" (?Show@?$PriorityQueue@UProcessor@@@@EEAAAEBUProcessor@@_N@Z)
1>Menu.obj : error LNK2001: unresolved external symbol "private: virtual bool __cdecl PriorityQueue::IsContainerEmpty(void)const " (?IsContainerEmpty@?$PriorityQueue@UProcessor@@@@EEBA_NXZ)
Класс с виртуальными методамиtemplate <typename T>
class Array
{
public:
Array(const size_t capasity) : _size(0), _capacity(capasity) {}
virtual ~Array() = default;
int Size() const;
bool IsEmpty() const;
virtual void Pop() = 0;
protected:
virtual void Resize(const int size) = 0;
size_t _size, _capacity;
};
template<typename T>
inline int Array<T>::Size() const
{
return _size;
}
template<typename T>
inline bool Array<T>::IsEmpty() const
{
return _size == 0;
}
Интерфейсtemplate <typename T>
class IContainer
{
protected:
virtual ~IContainer() = default;
virtual void Add(const T& item, const unsigned priority = 0) = 0;
virtual void Remove() = 0;
virtual const T& Show(const bool isFront = true) = 0;
virtual bool IsContainerEmpty() const = 0;
friend class Menu;
};
В наследуемы классах в файле .h
#include <iostream>
#include "Array.h"
#include "IContainer.h"
Как только я делаю реализацию в .h файле то ошибка пропадает, почему не видит в .cpp?