Converting std::__cxx11::string to std::string

后端 未结 8 1765
春和景丽
春和景丽 2020-11-22 16:07

I use c++11, but also some libraries that are not configured for it, and need some type conversion. In particular I need a way to convert std::__cxx11::string t

8条回答
  •  逝去的感伤
    2020-11-22 17:03

    If you can recompile all incompatible libs you use, do it with compiler option

    -D_GLIBCXX_USE_CXX11_ABI=1

    and then rebuild your project. If you can't do so, add to your project's makefile compiler option

    -D_GLIBCXX_USE_CXX11_ABI=0

    The define

    #define _GLIBCXX_USE_CXX11_ABI 0/1

    is also good but you probably need to add it to all your files while compiler option do it for all files at once.

提交回复
热议问题