使用:xcode 4.6.3。并提升 1.53.0
我正在尝试使用'boost::gregorian::days'来操纵日期和时间。当我为 OSX 10.8 构建时,它工作得非常好。问题是当我尝试构建 iOS 应用程序时。除了“gregorian”部分外,一切(包括其他增强功能)都运行良好。我已经使用了大量不同的方法来构建提升,但我似乎仍然无法让这部分工作。
有什么办法可以让它工作吗?
编辑:忘了提,我已经链接libboost_date_time.a
到该项目。
样本:
#include "boost/date_time/gregorian/gregorian.hpp"
#include <iostream>
int main()
{
int day = 5;
int month = 8;
int year = 2013;
boost::gregorian::date inputDate(year, month, day);
std::string stringDate = to_iso_extended_string(inputDate)
std::cout << stringDate;
return 0;
}
这给了我错误:
Undefined symbols for architecture i386:
"boost::gregorian::greg_month::as_long_string() const", referenced from:
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::__1::basic_ostream<char, std::__1::char_traits<char> >&) in myFile.o
"boost::gregorian::greg_month::as_short_string() const", referenced from:
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::__1::basic_ostream<char, std::__1::char_traits<char> >&) in myFile.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)