c++ - 命名空间 'std' 中的“atomic_uint32_t”未命名类型错误

标签 c++ compiler-errors

我的代码中有以下行:

#include <atomic>

std::atomic_uint32_t tmp;

但是,我收到以下编译错误:

'atomic_uint32_t' in namespace 'std' does not name a type.

我包括了 <cstdint>但错误仍然存​​在。

我的 GCC 版本:5.4.0,Ubuntu 14.04(64 位)

最佳答案

根据 Danh 的评论,我使用了

std::atomic<std::uint32_t>

瞧,它现在可以正常工作了。谢谢丹。

关于c++ - 命名空间 'std' 中的“atomic_uint32_t”未命名类型错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41541283/

相关文章:

c++ - 文件内容写入队列并统计元音字母的个数

c++ - Qt C++ - 如何将数据从工作线程传递到主线程?

vb.net - .ToString错误(vb.net)

java - 在 if 语句中返回导致无法访问的代码错误

java - 找不到适合 add( ) 的方法

c++ - CUSP 稀疏库给出奇怪的结果

c++ - 为什么在使用 O_DIRECT 写入文件时从文件中读回数据时数据损坏

c++ - Clang AST Matcher和AST Visitor之间有什么区别?

c# - 在分配它的 if-else 语句中使用未分配的局部变量

c# - 如何在 C# 中向我的 GUI 添加计算?