在哪里可以找到__sync_add_and_fetch_8?

4

我在尝试使用__sync_add_and_fetch时遇到了错误:

test8.cpp:(.text+0x90e): undefined reference to `__sync_add_and_fetch_8'
collect2: ld returned 1 exit status

请问如何纠正这个问题。
规格: GCC/G++: 4.4.1 GNU/Linux 2.6.32 SMP i686
非常感谢!
编辑: 除了提供的答案,还可以使用-march=i586或-march=i686来成功链接。
注意:这需要GCC/G++ 4.1.x及以上版本!
1个回答

5

该函数并不支持所有的x86架构。尝试指定您的架构,例如--with-arch=pentium4


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接