![](/img/trans.png)
[英]compile error for boost::date_time::days_until_weekday
[英]boost::date_time, g++-4.7.0, compile error
下面的代碼給出了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;
}
以下是重復出現的錯誤消息(編譯器輸出大量消息)
/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> >&)
我使用的是Ubuntu 12.04和libboost-date-time1.46.1。
有什么建議?
安裝boost-1.48解決了這個問題
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.