简体   繁体   English

boost :: date_time,g ++ - 4.7.0,编译错误

[英]boost::date_time, g++-4.7.0, compile error

The following code gives compile error with g++-4.7.0 but compiles fine with g++-4.6. 下面的代码给出了g ++ - 4.7.0的编译错误,但是用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;
}

The following is the error message that is repeatedly seen (compiler outputs 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. 我使用的是Ubuntu 12.04和libboost-date-time1.46.1。

Any suggestions? 有什么建议?

安装boost-1.48解决了这个问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM