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-07 12:17:38


Carsten Raas:
> Yes, these headers include atomicity.h.
> But they don't trigger the problem directly:
>
> #include <iostream>
> #include <string>
> #include <istream>
> int main()
> { std::string s="test"; std::cout << s << std::endl; }
>
> Works fine, if compiled with Intel icpc.

If <string> uses reference counting, it will use __sync_fetch_and_add on
copy:

#include <string>
int main()
{ std::string s="test"; std::string s2( s ); }

The use in <istream> is probably triggered by installing a locale facet,
something the DateTime library does.


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