Boost logo

Boost Users :

Subject: Re: [Boost-users] libboost_date_time: undefined reference to__sync_fetch_and_add_4
From: Peter Dimov (pdimov_at_[hidden])
Date: 2009-04-06 08:24:08


Carsten Raas:

> Finally, I tried to compile my demo program with the "-H" flag. Then I
> grep'ed all included header files for "sync_fetch". The only file with
> "sync_fetch" in it is atomicity.h and it appears three times, cf. the
> dependency tree:
> /opt/boost/1.38/intel/include/boost/date_time/date_generators.hpp
> /usr/include/c++/4.2.1/stdexcept
> /usr/include/c++/4.2.1/string
> /usr/include/c++/4.2.1/bits/basic_string.h
> /usr/include/c++/4.2.1/ext/atomicity.h
> /usr/include/c++/4.2.1/sstream
> /usr/include/c++/4.2.1/istream
> /usr/include/c++/4.2.1/ios
> /usr/include/c++/4.2.1/bits/ios_base.h
> /usr/include/c++/4.2.1/ext/atomicity.h
> /usr/include/c++/4.2.1/bits/locale_classes.h
> /usr/include/c++/4.2.1/ext/atomicity.h

So, it is what I thought; <string> and <istream> use __sync_fetch_and_add,
not Boost.

> I tried this one
> echo "#define __sync_fetch_and_add ERROR" >> boost/config/user.hpp
> echo "#define __sync_fetch_and_add_4 ERROR" >> boost/config/user.hpp

user.hpp is probably included after the standard library headers, so the
#define didn't have a chance to break them. :-)


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net