C++ Xcode头错误-命名空间'_STL&x27;不包含命名空间'_代表';

C++ Xcode头错误-命名空间'_STL&x27;不包含命名空间'_代表';,c++,xcode,macos,C++,Xcode,Macos,我目前正在Xcode上开发,当时我试图包含字符串 #include <string> 等等 这是系统头中的错误还是编译器中的错误?我正在使用Apple LLVM 4.2(我需要使用它)您不应该包含内部标题。如果要获取std::basic_stringinclude所需的声明,则不应包含内部标题。如果您想获得std::basic_stringinclude所需的声明,实际上是CryptoPP代码,它在代码中多次包含这样的声明。@bartimar:正因为库中使用了某些东西,它才是正确的

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

#include <string>
等等


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

您不应该包含内部标题。如果要获取
std::basic_string
include
所需的声明,则不应包含内部标题。如果您想获得
std::basic_string
include

所需的声明,实际上是CryptoPP代码,它在代码中多次包含这样的声明。@bartimar:正因为库中使用了某些东西,它才是正确的!我下载了CryptoPP-5.6.2,它不包含任何这样的头。内部标准库头是标准库的唯一业务。Cryptopp integer->CryptoLib->stdcpp->string->basic_string.tcc(箭头表示包含)@bartimar:这是通过
间接包含的。您是说您在编译cryptopp时遇到问题,其中包括编译器在
中抱怨的
。。。或者,您是否明确地包含了
,因为它最终恰好包含在其他地方?我在编译cryptopp时遇到了问题,其中包括。但是我可以编译整个cryptopp项目并制作一个静态库。但是当我在其他项目中包含静态库并使用一些cryptopp头时,我得到了这个错误(字符串的原因),实际上是cryptopp代码,它在代码中多次包含类似的内容。@bartimar:仅仅因为库中使用了某些东西,它才是正确的!我下载了CryptoPP-5.6.2,它不包含任何这样的头。内部标准库头是标准库的唯一业务。Cryptopp integer->CryptoLib->stdcpp->string->basic_string.tcc(箭头表示包含)@bartimar:这是通过
间接包含的。您是说您在编译cryptopp时遇到问题,其中包括编译器在
中抱怨的
。。。或者,您是否明确地包含了
,因为它最终恰好包含在其他地方?我在编译cryptopp时遇到了问题,其中包括。但是我可以编译整个cryptopp项目并制作一个静态库。但是当我在其他项目中包含静态库并使用一些cryptopp头时,我得到了这个错误(字符串的原因)
#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'