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

將 std::__cxx11::string 轉換為 std::string

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

問題描述

我用的是c++11,但也有一些庫沒有為它配置,需要一些類型轉換.特別是我需要一種將 std::__cxx11::string 轉換為常規 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.

如果我不轉換,我會收到這樣的鏈接器錯誤:

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?

如果您收到有關未定義引用符號的鏈接器錯誤,這些符號涉及 std::__cxx11 命名空間或標記 [abi:cxx11] 中的類型,那么這可能表明您正在嘗試將使用不同值編譯的目標文件鏈接在一起對于 _GLIBCXX_USE_CXX11_ABI 宏.當鏈接到使用舊版 GCC 編譯的第三方庫時,通常會發生這種情況.如果無法使用新 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 發行說明/雙 ABI

定義以下宏之前包括任何標準庫頭應該可以解決您的問題:#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

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

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

相關文檔推薦

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?(如何計算給定日期的周數?)
OpenCV with Network Cameras(帶有網絡攝像機的 OpenCV)
Export all symbols when creating a DLL(創建 DLL 時導出所有符號)
Getting started with OpenCV 2.4 and MinGW on Windows 7(Windows 7 上的 OpenCV 2.4 和 MinGW 入門)
主站蜘蛛池模板: 日韩欧美高清 | 中文字幕乱码一区二区三区 | 国产亚洲欧美在线 | 中文字幕国产一区 | 国产精品区二区三区日本 | 在线欧美亚洲 | 欧美日韩电影一区二区 | 欧美高清视频在线观看 | 国产一级一级毛片 | 操久久久 | 亚洲精品一区在线 | 亚洲成人中文字幕 | 欧美日韩成人影院 | 国产精品免费一区二区三区 | 一级毛片黄片 | 一区二区在线免费观看视频 | 亚洲午夜精品视频 | 国产99久久精品一区二区300 | 中文字幕亚洲国产 | 少妇一区二区三区 | 狠狠色综合久久丁香婷婷 | 日韩精品一区二区三区视频播放 | 色.com| 亚洲一区二区三区免费在线观看 | 中文字幕国产精品 | 99精品视频免费在线观看 | 中文字幕日韩一区 | 天堂中文在线观看 | 中文字幕不卡在线观看 | 蜜桃臀av一区二区三区 | 国产精品久久av | 成人av免费 | 欧美视频免费在线 | 日本又色又爽又黄的大片 | 秋霞电影院午夜伦 | 国产高清一区二区三区 | 日本成人福利 | www.日本在线 | 2021狠狠干 | 天堂久久网 | 福利网址|