MinGW g++: Multiple definition of vsnprintf when using to_string

Installing MinGW packages mingw32-libmingwex-* will link an appropriate version of vsnprintf and avoid the linker error.


This issue, i.e. multiple definition of vsnprintf, still exists in MinGW as December 2019.

After investigating a lot, I found the solution in the official mailing list.

It's a bug in mingwrt-5.2.2. Downgrading to the mingwrt-5.2.1 version solves that issue. To do that, just input the following command:

mingw-get upgrade mingwrt=5.2.1

Then restart the MinGW shell.

Read the full story here.

Note: MinGW-w64 and MinGW are separate projects, so the accepted solution is not so helpful to me, as I want to keep MinGW and not to move to MinGW-w64.