久久久久久久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 入門)
主站蜘蛛池模板: 欧美一区不卡 | 亚洲国产成人精品女人久久久 | 成人aaa视频 | 综合久久综合久久 | 国内自拍视频在线观看 | 日本黄色一级片视频 | 亚洲精品免费在线 | av大片| 欧美成人一区二免费视频软件 | 精品久久久久久久久久久 | 国产欧美日韩一区 | 国产亚洲网站 | 成人做爰www免费看 午夜精品久久久久久久久久久久 | 2020亚洲天堂| 国产日韩精品视频 | 精品国产一区二区三区av片 | 国产视频二区在线观看 | 天天影视亚洲综合网 | 欧美精品1区2区3区 免费黄篇 | 亚洲国产精品va在线看黑人 | 欧美性生活免费 | 国产亚洲欧美在线视频 | 久久成人精品视频 | 国产日韩欧美二区 | 羞羞的视频在线 | 97国产精品 | 中文字幕一区二区三区四区不卡 | 午夜精品久久久久久久星辰影院 | 国产日韩精品一区二区三区 | 欧美日韩一区二区三区视频 | 成人亚洲| 五月综合激情在线 | 国产精品1区2区3区 一区中文字幕 | 欧美精品久久久 | 欧美精品一区在线发布 | av片免费观看 | 超碰成人av| 一级免费在线视频 | 国产精品1区2区 | 免费国产一区二区 | 日韩成人在线一区 |