The Code:
#include <stdio.h>
#include <stdlib.h>
#include <stdatomic.h>
int main(int argc, char **argv)
{
char *ac, *bc, cc = '\a';
short *as, *bs, cs = 10;
int *ai, *bi, ci = 10;
long long *al, *bl, cl = 10;
ac = bc = &cc;
as = bs = &cs;
ai = bi = &ci;
al = bl = &cl;
atomic_compare_exchange_strong(ac, bc, cc);
atomic_compare_exchange_strong(as, bs, cs);
atomic_compare_exchange_strong(ai, bi, ci);
atomic_compare_exchange_strong(al, bl, cl);
atomic_compare_exchange_weak(ac, bc, cc);
atomic_compare_exchange_weak(as, bs, cs);
atomic_compare_exchange_weak(ai, bi, ci);
atomic_compare_exchange_weak(al, bl, cl);
return 0;
}
and this, the polink report error:
POLINK: error: Unresolved external symbol '___atomic_compare_exchange64_strong_explicit'.
POLINK: error: Unresolved external symbol '___atomic_compare_exchange64_weak_explicit'.
POLINK: fatal error: 2 unresolved external(s).
*** Error code: 1 ***
I guess this functions not in pelles c 's static lib file.