1

I'm compiling an application using clang++ 3.8 , libACE 6.3.3 and including the -std=c++11

But i'm having issues with inclusion of ACE Atomic_OP

including such headers:

#include <ace/ACE.h>
#include <ace/Thread.h>
#include <ace/TSS_T.h>
#include <ace/Atomic_Op.h>

i've

../game/libgame.a(WorldSocketMgr.cpp.o): In function ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator--()': /usr/include/ace/Atomic_Op.inl:72: undefined reference to ACE_Atomic_Op::decrement_fn_' ../game/libgame.a(WorldSocketMgr.cpp.o): In function ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator++()': /usr/include/ace/Atomic_Op.inl:50: undefined reference to ACE_Atomic_Op::increment_fn_' ../game/libgame.a(WorldSession.cpp.o): In function ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator=(long)': /usr/include/ace/Atomic_Op.inl:166: undefined reference to ACE_Atomic_Op::exchange_fn_' ../game/libgame.a(WorldSession.cpp.o): In function ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator-=(long)': /usr/include/ace/Atomic_Op.inl:114: undefined reference to ACE_Atomic_Op::exchange_add_fn_' clang: error: linker command failed with exit code 1 (use -v to see invocation)

How can i solve it?

UPDATE:

i've changed

ACE_Atomic_Op<ACE_Thread_Mutex, time_t> m_timeOutTime;

in

ACE_Atomic_Op<ACE_Thread_Mutex, int> m_timeOutTime;

and

ACE_Atomic_Op<ACE_Thread_Mutex, long> m_refs;

in

ACE_Atomic_Op<ACE_Thread_Mutex, int> m_refs;

it now compiles, but i'm not sure it's a safe solution.

Joseph
  • 1,029
  • 13
  • 26
  • Do you have the same inline settings when you compile ACE and when you compile your application, check the INLINE defines that we pass when invoking the compiler – Johnny Willemsen Aug 16 '16 at 08:03
  • I'm using libace-6.0.3 from ubuntu repositories, i'm not compiling them – Joseph Aug 17 '16 at 07:24
  • Unfortunately i'm not able to compile with clang using external ACE from OS. So i'm trying now to include it in my project: http://stackoverflow.com/questions/39014042/pic-error-compiling-ace-with-clang – Joseph Aug 18 '16 at 09:05
  • @JohnnyWillemsen could you explain me better what do you mean please? – Joseph Aug 18 '16 at 18:47

1 Answers1

1

Update

This was caused by a bug in ACE prior to version 6.4.3. It is now fixed.


Original Answer:

A little late response, but I hope it may help anyone who finds this post in the future.

It looks like ACE has a bug (or just did not update their code). Unfortunately, the only solution for now is to hack ACE's files.

You need to find edit either config-linux.h or config-macosx-snowleopard.h - based on what you use. Then you find this chunk of oode and delete it:

# ifdef __clang__
#  undef ACE_HAS_GCC_ATOMIC_BUILTINS
# endif
Zaffy
  • 16,801
  • 8
  • 50
  • 77