sheriff icon indicating copy to clipboard operation
sheriff copied to clipboard

[Compile] reference to ‘atomic’ is ambiguous

Open jahentao opened this issue 1 year ago • 1 comments

When compile with gcc-9 on Ubuntu20.04, the atomic struct is ambiguous with which in bits/atomic_base.h

include/xmemory_opt.h:470:5: error: reference to ‘atomic’ is ambiguous with `bits/atomic_base.h`
  470 |     atomic::atomic_set(&_doChecking, 0);
      |     ^~~~~~
In file included from /usr/include/c++/9/bits/shared_ptr_atomic.h:33,
                 from /usr/include/c++/9/memory:82,
                 from ./heaplayers/stlallocator.h:34,
                 from ./heaplayers/mmapheap.h:44,
                 from include/xthread.h:20,
                 from include/xrun.h:37,
                 from source/libsheriff.cpp:36:
/usr/include/c++/9/bits/atomic_base.h:145:12: note: candidates are: ‘template<class _Tp> struct std::atomic’
  145 |     struct atomic;
      |            ^~~~~~
In file included from include/xpersist_opt.h:25,
                 from include/xglobals.h:36,
                 from include/xmemory_opt.h:44,
                 from include/xrun.h:43,
                 from source/libsheriff.cpp:36:
include/util/atomic.h:35:7: note:                 ‘class atomic’
   35 | class atomic {
      |       ^~~~~~

jahentao avatar Jul 12 '23 01:07 jahentao

Did you solve it?

dufuhang avatar Jul 25 '23 03:07 dufuhang