Skip to content
Advertisement

Tag: 32bit-64bit

undefined reference to sync_fetch_and_add_4

Whenever I try to use __sync_fetch_and_add with -m32 on a 64 bit machine, I get the following error, while it compiles fine with normal 64 bit. I am using gcc compiler 4.1.2. What can be the problem here and what is the solution? Answer Using -march=i486 flag did the trick for me.

Advertisement