NO

Author Topic: Atomic operation bug  (Read 2839 times)

Xsoda

  • Guest
Atomic operation bug
« on: January 12, 2013, 04:09:09 AM »
The Code:
Code: [Select]
#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:

Quote
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.

Offline Vortex

  • Member
  • *
  • Posts: 802
    • http://www.vortex.masmcode.com
Re: Atomic operation bug
« Reply #1 on: January 12, 2013, 10:30:01 AM »
« Last Edit: January 12, 2013, 11:28:37 AM by Stefan Pendl »
Code it... That's all...