我无法理解在Visual Studio 2022中链接到spdlog的include文件夹时出现了什么问题

omvjsjqw  于 2023-11-21  发布在  其他
关注(0)|答案(1)|浏览(281)

我在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':没有这样的文件或目录

  1. //Log.h
  2. #pragma once
  3. #include <memory>
  4. #include "Core.h"
  5. #include "spdlog/spdlog.h"
  6. namespace Hazel {
  7. class HAZEL_API Log
  8. {
  9. public:
  10. static void Init();
  11. inline static std::shared_ptr<spdlog::logger>& GetCoreLogger() { return s_CoreLogger; }
  12. inline static std::shared_ptr<spdlog::logger>& GetClientLogger() { return s_ClientLogger; }
  13. private:
  14. static std::shared_ptr<spdlog::logger> s_CoreLogger;
  15. static std::shared_ptr<spdlog::logger> s_ClientLogger;
  16. };
  17. }

字符串
这是我的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.
我已经尝试重新链接的文件,我已经去了许多不同的论坛,看看是否有其他人有这个问题之前。我有点卡住了,不能进步,而不过去这个问题。如果有人能帮助我,那将是伟大的。

pxiryf3j

pxiryf3j1#

截图:xxx\include\spdlog

  1. #include "spdlog/spdlog.h"

字符串
这意味着编译器正在寻找xxx\include\spdlog\spdlog. h文件。你真的有这样一个路径的文件吗?
请尝试添加其他包含目录C:\Users\peyton\source\repos\Hazel2\Hazel\Hazel\src\Hazel\vendor\spdlog-1.x\include

相关问题