0

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

#include <string>

一切都很好,但是当我包含 CryptoPP 标头时,其中包括<string>

#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(我需要使用它)

4

1 回答 1

3

您不应该包含内部标题。如果您想获得std::basic_stringinclude所需的声明<string>

于 2013-08-21T08:19:35.847 回答