【发布时间】:2014-05-09 17:42:09
【问题描述】:
只是想像这样将时间戳记录到输出文件中:
//#include <boost/date_time.hpp>
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
std::cout << boost::posix_time::to_iso_extended_string(now) << std::endl;
// ideally one line
std::cout << boost::posix_time::to_iso_extended_string(
boost::posix_time::second_clock::local_time()) << std::endl;
在 boost 中出现错误:
boost::date_time::month_formatter<boost::gregorian::greg_month, boost::date_time::iso_extended_format<char>, char>::format_month(boost::gregorian::greg_month const&, std::ostream&)':
/usr/include/boost/date_time/date_formatting.hpp:44: undefined reference toboost::gregorian::greg_month::as_short_string() const'
/usr/include/boost/date_time/date_formatting.hpp:49:未定义对`boost::gregorian::greg_month::as_long_string() const'的引用
我知道这可能是我最终没有提升但不确定如何调试的问题,有什么想法吗?
【问题讨论】:
-
你使用哪个版本的 boost?
标签: date datetime boost time iso