gpt4 book ai didi

c++ - Xcode header 错误 - 命名空间 '_STL' 未包含命名空间 '_Rep'

转载 作者:行者123 更新时间:2023-11-28 00:42:07 27 4
gpt4 key购买 nike

当我尝试包含字符串时,我目前正在 Xcode 上进行开发

#include <string>

一切都很好,但是当我包含包含 <string> 的 CryptoPP header 时

#include "integer.h" //integer.h have #include <string> in it

编译时出现如下错误

bits/basic_string.tcc:63:11: Cannot define or redeclare '_S_max_size' here because     namespace '_STL' does not enclose namespace '_Rep'
bits/basic_string.tcc:63:28: Use of undeclared identifier 'npos'; did you mean 'fpos'?
bits/basic_string.tcc:63:28: Use of class template fpos requires template arguments
bits/basic_string.tcc:63:33: Expected ')'
bits/basic_string.tcc:68:11: Cannot define or redeclare '_S_terminal' here because namespace '_STL' does not enclose namespace '_Rep'
bits/basic_string.tcc:72:44: Cannot define or redeclare 'npos' here because namespace '_STL' does not enclose namespace 'basic_string'
bits/basic_string.tcc:99:2: Unknown type name 'size_type'; did you mean 'size_t'?
bits/basic_string.tcc:100:9: Use of undeclared identifier '__beg'
bits/basic_string.tcc:100:9: Use of undeclared identifier '__end'
bits/basic_string.tcc:100:9: Use of undeclared identifier '_Rep'

等等……

这是系统头文件中的错误还是编译器中的错误?我正在使用 Apple LLVM 4.2(我需要使用它)

最佳答案

您不应该包含内部 header 。如果您想获得 std::basic_string 所需的声明包括 <string> .

关于c++ - Xcode header 错误 - 命名空间 '_STL' 未包含命名空间 '_Rep',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18352240/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com