我在Youtube上关注The Cherno的系列,在Logging事件中,他使用SPDtool作为实际游戏引擎的日志。他使用#include "spdlog/spdlog.h"
函数将spdlog.h
文件调用到Log.h
中,但我一直收到错误消息,说它无法访问spdlog/spdlog.h
C:\Users\peyton\source\repos\Hazel2\Hazel\src\Hazel\Log.h(5,10):致命错误C1083:无法打开包含文件:'spdlog':没有这样的文件或目录
//Log.h
#pragma once
#include <memory>
#include "Core.h"
#include "spdlog/spdlog.h"
namespace Hazel {
class HAZEL_API Log
{
public:
static void Init();
inline static std::shared_ptr<spdlog::logger>& GetCoreLogger() { return s_CoreLogger; }
inline static std::shared_ptr<spdlog::logger>& GetClientLogger() { return s_ClientLogger; }
private:
static std::shared_ptr<spdlog::logger> s_CoreLogger;
static std::shared_ptr<spdlog::logger> s_ClientLogger;
};
}
字符串
这是我的Log. h文件的代码,如果有帮助的话。这里还有spdlog文件夹及其包含文件夹的文件路径:C:\Users\peyton\source\repos\Hazel2\Hazel\Hazel\src\Hazel\vendor\spdlog-1.x\include What my linking looks like for the Addition Include Libraries incase maybe I did something wrong there.
我已经尝试重新链接的文件,我已经去了许多不同的论坛,看看是否有其他人有这个问题之前。我有点卡住了,不能进步,而不过去这个问题。如果有人能帮助我,那将是伟大的。
1条答案
按热度按时间pxiryf3j1#
截图:
xxx\include\spdlog
字符串
这意味着编译器正在寻找xxx\include\spdlog\spdlog. h文件。你真的有这样一个路径的文件吗?
请尝试添加其他包含目录
C:\Users\peyton\source\repos\Hazel2\Hazel\Hazel\src\Hazel\vendor\spdlog-1.x\include