TheCherno / Hazel

Hazel Engine
Apache License 2.0
11.76k stars 1.51k forks source link

error C2079: '_' uses undefined struct 'fmt::v10::detail::type_is_unformattable_for<T,char>' #683

Open hoho965191737 opened 2 months ago

hoho965191737 commented 2 months ago

I wonder why? Thank you! error C2079: '_' uses undefined struct 'fmt::v10::detail::type_is_unformattable_for<T,char>' error C2338: Cannot format an argument. To make type T formattable provide a formatter specialization: https://fmt.dev/latest/api.html#udt

Log.h

#include <memory>
#include "Core.h"
#include "spdlog/spdlog.h"
#include "spdlog/fmt/ostr.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.cpp

#include "Log.h"
#include "spdlog/sinks/stdout_color_sinks.h"

namespace Hazel {
    std::shared_ptr<spdlog::logger> Log::s_CoreLogger;
    std::shared_ptr<spdlog::logger> Log::s_ClientLogger;

    void Log::Init() {
        spdlog::set_pattern("%^[%T] %n:%v%$");
        s_CoreLogger = spdlog::stdout_color_mt("Hazel");
        s_CoreLogger->set_level(spdlog::level::trace);

        s_ClientLogger = spdlog::stdout_color_mt("App");
        s_ClientLogger->set_level(spdlog::level::trace);
    }
}

image

323931 commented 2 months ago

bro,i have the same question, you fix it?

VagueLobster commented 2 months ago

bro,i have the same question, you fix it?

There's a fix in Cherno's discord server in the Game-Engine-Series channel, but you might have to scroll up quite a bit 👍

323931 commented 2 months ago

bro,i have the same question, you fix it?

There's a fix in Cherno's discord server in the Game-Engine-Series channel, but you might have to scroll up quite a bit 👍

thank you bro,do you have a url? i do not know how to get the discord

Kirdow commented 2 months ago

thank you bro,do you have a url? i do not know how to get the discord

It's in the readme

323931 commented 2 months ago

thank you bro,do you have a url? i do not know how to get the discord

It's in the readme

Thank you!!!!!!!!!

hoho965191737 commented 2 months ago

bro,i have the same question, you fix it?

There's a fix in Cherno's discord server in the Game-Engine-Series channel, but you might have to scroll up quite a bit 👍

No, I haven't solved it yet. Did you find the information that solved the problem? Is there a specific time when we can locate the information to solve the problem? Thank you

hoho965191737 commented 2 months ago

bro,i have the same question, you fix it?

No, I haven't solved it yet. Did you find the information that solved the problem? Is there a specific time when we can locate the information to solve the problem? Thank you

323931 commented 2 months ago

bro,i have the same question, you fix it?

No, I haven't solved it yet. Did you find the information that solved the problem? Is there a specific time when we can locate the information to solve the problem? Thank you

bro,i fixed it,you can use e.ToString() instead of e 微信图片_20240924111806

hoho965191737 commented 2 months ago

bro,i have the same question, you fix it?老哥,我也有同样的问题,你解决了吗?

No, I haven't solved it yet. Did you find the information that solved the problem? Is there a specific time when we can locate the information to solve the problem? Thank you不,我还没解决。您找到解决问题的信息了吗?有没有具体的时间我们可以找到信息来解决问题?谢谢

bro,i fixed it,you can use e.ToString() instead of e兄弟,我修好了,你可以用 e.ToString() 代替 e 微信图片_20240924111806

Okay, thanks. I'll go back and try