Skip to content

"Unhandled exception: Microsoft C++ exception: std::bad_alloc" only appears on Debug #1342

Answered by sbrajchuk
H4x0r-000 asked this question in Q&A
Discussion options

You must be logged in to vote

I had the same exception on Debug with this code:

#include <drogon/drogon.h>
int main() {
    //Set HTTP listener address and port
    drogon::app().addListener("0.0.0.0",80);
    //Load config file
    //drogon::app().loadConfigFile("../config.json");
    //Run HTTP framework,the method will block in the internal event loop
    drogon::app().run();
    return 0;
}

I'm using Visual Studio 2022.
Installed drogon via vcpkg.
Exception dissapeared after loading correct dlls.
At first I've used dlls from d:\Dev\vcpkg\installed\x64-windows\bin\ and had std::bad_alloc.
Then I've used dlls from d:\Dev\vcpkg\installed\x64-windows\debug\bin\ and exception disappeared.

If I understand correctly, dr…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@Ayman250
Comment options

@sbrajchuk
Comment options

@Ayman250
Comment options

@sbrajchuk
Comment options

Answer selected by an-tao
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants