As detailed in the Header dependency streamlining, originally found here, many of the standard C++ library include files have been edited to only include the smallest possible number of additional files. As such, many C++ programs that used std::memcpy without including <cstring>, or used std::auto_ptr without including <memory> will no longer compile.
If you receive: error: 'strcmp' was not declared in this scope
Fix it by including: #include <cstring> in the offending source file.
转自:http://rubypdf.diandian.com/post/2011-04-13/360263
本文介绍了一项关于C++标准库头文件依赖精简的工作,该工作减少了头文件间的相互依赖,使得包含特定功能的头文件变得更加独立。然而,这一改动可能导致以前仅需包含单一头文件即可使用的功能现在需要显式包含多个头文件才能正常编译。例如,使用`std::memcpy`现在可能需要包含`<cstring>`,而使用`std::auto_ptr`则需要包含`<memory>`。

被折叠的 条评论
为什么被折叠?



