Boost :: date_time, g ++ - 4.7.0, compilation error

The following code gives a compilation error with g ++ - 4.7.0, but compiles with g ++ - 4.6.

#include <iostream> #include <boost/date_time/local_time/local_time.hpp> using namespace std; int main(){ boost::posix_time::ptime time_t_epoch(boost::gregorian::date(1970,1,1)); cout << time_t_epoch << endl; return 0; } 

Below is an error message that is repeatedly displayed (the compiler displays a lot of messages)

 /usr/include/boost/date_time/local_time/local_date_time.hpp:433:84: error: use of deleted function boost::shared_ptr<boost::date_time::time_zone_base<boost::posix_time::ptime, char> >::shared_ptr(const boost::shared_ptr<boost::date_time::time_zone_base<boost::posix_time::ptime, char> >&) 

I am using Ubuntu 12.04 and libboost-date-time1.46.1.

Any suggestions?

+6
source share
1 answer

The problem was solved by installing boost-1.48

+6
source

Source: https://habr.com/ru/post/914447/


All Articles