std::string 报错
时间: 2023-09-10 21:06:13 浏览: 147
当使用GCC 5编译时,std::string类型会被处理为std::__cxx11::basic_string<char>。如果你调用的库在编译时未启用C++11特性,则实际上std::string将被处理为std::basic_string<char>。如果将C++11的std::string作为参数传递给非C++11的库,就会出现报错,如"error: cannot convert 'const std::__cxx11::basic_string<char>' to 'const char*'"或者未定义的方法引用(undefined reference)。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [编译报错:std::basic_string与std::__cxx11::basic_string无法匹配的问题](https://blog.csdn.net/n_o_n/article/details/99336919)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *3* [C++结构体里面string类型赋值问题](https://download.csdn.net/download/weixin_38571992/14857036)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文