I have no idea what's wrong with this. Recently built a new PC and it worked just fine (same project, same settings in visual studio, etc). But for some reason any time I try fmt::format
it will give me an access violation exception. Though if formatting with spdlog for example it works fine.
const char* TextureException::what() const noexcept
{
mWhat = fmt::format("{}
[Info] {}", getType(), getInfo()); // access violation
return mWhat.c_str();
}
getType()
just returns some identifying information, its hard coded right now so its not a nullptr or anything. Same with getInfo()
(except this returns file and line number)
And even just testing some code will give me an access violation error:
int main(int argc, char** argv)
{
std::string test = fmt::format("Testing {}", 32); // access violation
std::cout << test << "
";
}
I am completely stumped as to why this is no longer working on the new PC.
question from:
https://stackoverflow.com/questions/65855022/fmtformat-access-violation 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…