strcmp was not declared in this scope(转)

本文介绍了一项关于C++标准库头文件依赖精简的工作,该工作减少了头文件间的相互依赖,使得包含特定功能的头文件变得更加独立。然而,这一改动可能导致以前仅需包含单一头文件即可使用的功能现在需要显式包含多个头文件才能正常编译。例如,使用`std::memcpy`现在可能需要包含`<cstring>`,而使用`std::auto_ptr`则需要包含`<memory>`。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值