久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

將 std::__cxx11::string 轉(zhuǎn)換為 std::string

Converting std::__cxx11::string to std::string(將 std::__cxx11::string 轉(zhuǎn)換為 std::string)
本文介紹了將 std::__cxx11::string 轉(zhuǎn)換為 std::string的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我用的是c++11,但也有一些庫沒有為它配置,需要一些類型轉(zhuǎn)換.特別是我需要一種將 std::__cxx11::string 轉(zhuǎn)換為常規(guī) std::string 的方法,但是谷歌搜索我找不到這樣做的方法并把前面的(string)不起作用.

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 to regular std::string, but googling I can't find a way to do this and putting (string) in front does not work.

如果我不轉(zhuǎn)換,我會收到這樣的鏈接器錯誤:

If I do not convert I get linker errors like this:

undefined reference to `H5::CompType::insertMember(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, H5::DataType const&) const'

推薦答案

您是否可能使用 GCC 5?

Is it possible that you are using GCC 5?

如果您收到有關(guān)未定義引用符號的鏈接器錯誤,這些符號涉及 std::__cxx11 命名空間或標記 [abi:cxx11] 中的類型,那么這可能表明您正在嘗試將使用不同值編譯的目標文件鏈接在一起對于 _GLIBCXX_USE_CXX11_ABI 宏.當鏈接到使用舊版 GCC 編譯的第三方庫時,通常會發(fā)生這種情況.如果無法使用新 ABI 重建第三方庫,則需要使用舊 ABI 重新編譯代碼.

If you get linker errors about undefined references to symbols that involve types in the std::__cxx11 namespace or the tag [abi:cxx11] then it probably indicates that you are trying to link together object files that were compiled with different values for the _GLIBCXX_USE_CXX11_ABI macro. This commonly happens when linking to a third-party library that was compiled with an older version of GCC. If the third-party library cannot be rebuilt with the new ABI then you will need to recompile your code with the old ABI.

來源:GCC 5 發(fā)行說明/雙 ABI

定義以下宏之前包括任何標準庫頭應(yīng)該可以解決您的問題:#define _GLIBCXX_USE_CXX11_ABI 0

Defining the following macro before including any standard library headers should fix your problem: #define _GLIBCXX_USE_CXX11_ABI 0

這篇關(guān)于將 std::__cxx11::string 轉(zhuǎn)換為 std::string的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

boost_1_60_0 .zip installation in windows(Windows 中的 boost_1_60_0 .zip 安裝)
How do I get console output in C++ with a Windows program?(如何使用 Windows 程序在 C++ 中獲得控制臺輸出?)
How do I calculate the week number given a date?(如何計算給定日期的周數(shù)?)
OpenCV with Network Cameras(帶有網(wǎng)絡(luò)攝像機的 OpenCV)
Export all symbols when creating a DLL(創(chuàng)建 DLL 時導出所有符號)
Getting started with OpenCV 2.4 and MinGW on Windows 7(Windows 7 上的 OpenCV 2.4 和 MinGW 入門)
主站蜘蛛池模板: 中文字幕亚洲天堂 | 免费黄色网址在线观看 | 日韩一级在线 | www.成人网| 蜜桃色一区二区三区 | 日韩性生活视频 | 欧美精品一区二区在线观看 | av福利网 | 中文字幕在线观看网站 | 欧美一级片免费 | 亚洲第一av | 黄色小视频免费观看 | 日韩色在线 | 台湾av在线 | 欧美激情综合 | 在线观看一区 | 久久精品在线观看 | 久久激情综合 | 日本高清www | 色婷婷av一区二区 | 久久精品一区二区 | 99久久婷婷国产综合精品草原 | 一区二区三区四区在线播放 | 日韩精品在线免费观看 | 国产免费一级片 | 又黄又爽又色视频 | 成人激情视频在线观看 | 成人小视频在线观看 | av免费观看网站 | 亚洲精品久久久 | 午夜网址| 黄色大片在线免费观看 | 夜夜狠狠擅视频 | 黄色成人免费视频 | 国产综合第一页 | 中文字幕理论片 | 国产激情视频 | 乳色吐息樱花 | 久久精彩 | 天海翼一区二区 | 国产精品成人免费视频 |