Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
3.4k views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...