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

前端 未结 4 1979
Happy的楠姐
Happy的楠姐 2020-12-08 17:40

I just started using MinGW for Windows. When trying to create executable using

g++ a.cpp -o a.exe -std=c++14

for the code below:



        
4条回答
  •  萌比男神i
    2020-12-08 17:49

    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.

提交回复
热议问题