原子复合结构的链接器问题
linker issue with atomic composite struct c++
在Cygwin环境下使用gcc 4.9.3编译以下程序失败
#include <atomic>
struct composite_struct
{
int anInt;
int* aPointer;
};
int main()
{
composite_struct non_atomic_struct;
non_atomic_struct.anInt = 1001;
non_atomic_struct.aPointer = new int(1000);
std::atomic<composite_struct> atomic_struct;
atomic_struct.store(non_atomic_struct);
return 0;
}
链接器发送错误消息[...]"undefined reference to '__atomic_store_16'"
[...] relocation truncated to fit: R_X86_64_PC32 against undefined symbol '__atomic_store_16'[...]
我在这里看到这个问题存在于早期版本的gcc,它仍然是gcc 4.9.3的情况?
谢谢。
代码存在可移植性问题。
的代码片段- 可以在Visual Studio Express 2013和GNU/Linux系统上编译。
- 在gcc 4.9.2或4.9.3的cygwin环境下无法编译(链接失败)
相关文章:
- 使用jsoncpp库时出现链接问题
- Cmake 链接问题:未定义对 Button::mousePressEvent(QGraphicsSceneMouseE
- 如何将GTest与CMake一起使用?遵循谷歌指南时的链接问题
- 未解决的外部链接问题
- 'make check' GLIBC 运行时的链接问题
- 在树莓派上用libtorch构建程序时的链接问题
- 野牛弹性链接问题
- 与 AWS 开发工具包的链接问题
- Qt & Firebase C++ SDK 在 iOS 上的链接问题
- 链接问题 boost::p ython::numpy.
- 与 32 位共享对象的链接问题
- 在单元测试项目中包括 .c 文件,并从多个 cpp 文件访问它而不会出现链接问题
- 安卓链接问题
- LLVM 传递链接问题:未定义的符号
- Cmake Mac OSX库链接问题:在Linux上进行编译,但在Mac上进行了编译
- 用libclang解析源文件 - 链接问题包括文件
- C / C++链接问题与非常简单的设置
- Zbar 在 vs2015 链接问题
- Vulkan + GLFW + Cmake在Linux环境下的链接问题
- TFS构建由于链接问题而失败