gpt4 book ai didi

cstdio 或 cstdlib 等 C++ header 引发编译错误

转载 作者:太空宇宙 更新时间:2023-11-04 10:47:00 25 4
gpt4 key购买 nike

以下代码会引发许多错误:

namespace ns1 {
#include <boost/lockfree/queue.hpp>
...
}

/usr/include/c++/4.9/cstdlib:118: error: '::div_t' has not been declared using ::div_t; ^

/usr/include/c++/4.9/cstdlib:119: error: '::ldiv_t' has not been declared using ::ldiv_t; ^

据我所知,错误 cstdlib 在命名空间中,但 stdlib.h 不在(它包含在 cstdlib 中并用于大多数定义)。

哪些技术解决方案可以让我将包含内容保留在自定义命名空间下并解决任何冲突?

最佳答案

我发现了问题 - 包含在命名空间内

关于cstdio 或 cstdlib 等 C++ header 引发编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32732379/

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