LINK2019 unresolved external symbol

Рейтинг: 0Ответов: 0Опубликовано: 26.04.2023

Моя проблема не особо обычная(

У меня есть статическая библиотека. В ней шаблонный класс с статическим методом

template<typename T>
class VertexBuffer
{
public:
    virtual ~VertexBuffer() = default;

    virtual void Bind() const = 0;
    virtual void Unbind() const = 0;

    static VertexBuffer* Create(T* vertices, uint32_t num);
};

template<typename T>
VertexBuffer<T>* VertexBuffer<T>::Create(T* vertices, uint32_t num)
{
    GraphicsContext::API api = GraphicsContext::GetAPI();
    
    switch (api)
    {
    case GraphicsContext::API::None: PF_CORE_ASSERT(false, "None API "); return nullptr;
    case GraphicsContext::API::DirectX11: return new DX::DX11VertexBuffer<T>(vertices, num);
    }

    PF_CORE_ASSERT(false, "Unknown Graphics API!");
    return nullptr;
}

В самой библиотеке я вызываю этот Create(...)

И при сборке приложения оно жалуется такими словами

Severity    Code    Description Project File    Line    Suppression State
Error   LNK2019 unresolved external symbol "public: static class                 PF::Render::VertexBuffer<struct PF::Render::DX::Vertex> * __cdecl PF::Render::VertexBuffer<struct PF::Render::DX::Vertex>::Create(struct PF::Render::DX::Vertex *,unsigned int)" (?Create@?$VertexBuffer@UVertex@DX@Render@PF@@@Render@PF@@SAPEAV123@PEAUVertex@DX@23@I@Z) referenced in function "private: void __cdecl PF::Render::DX::DX11Context::InitializeScene(void)" (?InitializeScene@DX11Context@DX@Render@PF@@AEAAXXZ)  Sandbox D:\projects\test\Peakforge\Sandbox\Peakforge.lib(DX11Context.obj)   1   

Ответы

Ответов пока нет.