Where to find __sync_add_and_fetch_8?

I got errors while trying to use __sync_add_and_fetch:

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

Please advise how to fix this.

Specifications: GCC / g ++: 4.4.1 GNU / Linux 2.6.32 SMP i686

Many thanks!

EDIT:

In addition to the answer provided, you can successfully use -march = i586 or -march = i686.

Note. This requires GCC / g ++ 4.1.x and higher!

+4
source share
1 answer

This feature is not supported on all x86 architectures. Try specifying your architecture, for example --with-arch=pentium4 .

+5
source

Source: https://habr.com/ru/post/1305834/


All Articles