Skip to content
Advertisement

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?

JavaScript

Advertisement

Answer

Using -march=i486 flag did the trick for me.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement