我在使用 boost 时遇到问题。我使用 blue go 应用程序安装了 boost,我通过打开属性管理器并包含了 boost 库来包含了 boost 库。没有红色波浪线,但是当尝试从他们的网站编译示例时,我收到一条错误消息“致命错误 LNK1104:无法打开文件 'libboost_date_time-vc110-mt-gd-1_54.lib'”
这是我试图从这个链接做的例子(活着的日子例子)
http://www.boost.org/doc/libs/1_34_0/doc/html/date_time/examples.html
int main()
{
std::string s;
std::cout << "Enter birth day YYYY-MM-DD (eg: 2002-02-01): ";
std::cin >> s;
try {
date birthday(from_simple_string(s));
date today = day_clock::local_day();
days days_alive = today - birthday;
days one_day(1);
if (days_alive == one_day) {
std::cout << "Born yesterday, very funny" << std::endl;
}
else if (days_alive < days(0)) {
std::cout << "Not born yet, hmm: " << days_alive.days()
<< " days" <<std::endl;
}
else {
std::cout << "Days alive: " << days_alive.days() << std::endl;
}
}
catch(...) {
std::cout << "Bad date entered: " << s << std::endl;
}
return 0;
}