Qt 5.1 Beta版错误使用std::atomic c++11特性
Qt 5.1 Beta Error using std::atomic c++11 feature
我刚刚开始使用QT,我仍然熟悉编译过程。目前,我正试图将现有的QT项目移植到Mac。此应用程序可在Linux和Windows上编译和运行。
当我在Mac OSX 10.8.2上编译项目时,我得到了这个c++11相关的错误,
#include ../xxx/pch.h:71:10: fatal error: 'atomic' file not found
#include <atomic>
^
1 error generated.
make[1]: *** [debug/xxx/objective-c++.pch] Error 1
make: *** [debug] Error 2
11:32:01: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project xxx (kit: Qt5.1.0)
When executing step 'Make'
中包含了以下标志。支持c++11,
QMAKE_CXXFLAGS += -std=c++11
CONFIG += c++11
我正在使用预构建的QT5.1Beta包(Clang)构建项目,我相信它已经启用了c++11。
我在下面的位置看到了原子头/应用程序/xcode/内容/开发/工具链/XcodeDefault.xctoolchain/usr/lib/c++/v1/原子在/usr/lib/c++/v1/atomic
我试过包含完整路径的测试,/应用程序/xcode/内容/开发/工具链/XcodeDefault.xctoolchain/usr/lib/c++/v1/原子
我得到下面的错误,
In file included from ../xxx/pch.h:71:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/atomic:535:2:
error: atomic is not implemented
In file included from ../xxx/pch.h:124:
../../../yyy.h:308:12: error: no type named 'atomic' in namespace 'std'
std::atomic<bool> m_signaled;
我在这里错过了什么?
Add also
macx:QMAKE_CXXFLAGS += -stdlib=libc++
macx:QMAKE_LFLAGS += -stdlib=libc++
也许是有点晚了,但我使用-std=gnu++0x
标志
相关文章:
- std::atomic和std::condition_variable wait,notify_*方法之间的区别
- 在 lambda 表达式中使用 std::atomic
- C++std::atomic在程序员级别保证了什么
- 如果在 2 个线程中使用,是否值得将size_t声明为 std::atomic?
- 在 C++20 之前和之后初始化 std::atomic
- std::atomic 和 std::mutex 的相对性能
- 简单使用 std::atomic 在两个线程之间共享数据
- Port pthread_cond_broadcast to std::atomic
- std::atomic中的任何内容都是免费等待的
- 为什么 std::atomic 构造函数在 C++14 和 C++17 中的行为不同
- std::atomic是如何实现的
- 使用 std::atomic 标志和 std::condition_variable 在工作线程上等待
- 为什么std::atomic的默认构造函数不默认初始化底层存储值
- 读取互斥对象范围之外的volatile变量,而不是std::atomic
- 为什么std::atomic中的所有成员函数都同时出现在有volatile和没有volatile的情况下
- 访问共享内存而不使用易失性、std::atomic、信号量、互斥锁和自旋锁
- 两个不同的进程,在同一地址上有 2 个 std::atomic 变量?
- 原子读取,然后使用 std::atomic 写入
- std::atomic::fetch_add是x86-64上的串行化操作
- 实际上,C++11 中 std::atomic 的内存占用量是多少?