Precompile header issue

24 views Asked by At

I added Pre.h to EngineWindow.cpp but EngineWindow.h does not recognize Pre.h

I did this the same way in another project, but there were no problems there.

Pre.h:

#pragma once

#include <EngineBase\Pre.h>
#include <EngineBase\EngineMath.h>

#include <vector>
#include <map>
#include <list>
#include <string>


EngineWindow.cpp:

#include "Pre.h"
#include "EngineWindow.h"

EngineWindow::EngineWindow()
{
}

EngineWindow::~EngineWindow()
{
}

EngineWindow.h:

 #pragma once

class EngineWindow 
{
public:
    // constrcuter destructer
    EngineWindow();
    ~EngineWindow();

    // constrcuter destructer
    EngineWindow(const EngineWindow& _Other) = delete;
    EngineWindow(EngineWindow&& _Other) noexcept = delete;
    EngineWindow& operator=(const EngineWindow& _Other) = delete;
    EngineWindow& operator=(EngineWindow&& _Other) noexcept = delete;

    void OpenWindow();
    void MessageLoop();

    void SetHinstance(HINSTANCE _HInst)
    {
        HInst = _HInst;
    }
    HINSTANCE HInst;
    HWND Hwnd;

    std::string WindowTitle = "Title"; //error
private:
    static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
    void Register();
    void Create();

};


std::string WindowTitle = "Title"; in this part

Error C2039: 'string': is not a member of 'std'

Pre.h includes <string>, but why does an error appear?

0

There are 0 answers