在iOS中使用boost gregorian

时间:2013-08-05 09:12:29

标签: c++ ios boost

使用:xcode 4.6.3。并提升1.53.0

我正在尝试使用'boost :: gregorian :: days'来操纵日期和时间。当我为OSX 10.8构建时,它工作得非常好。问题是我正在尝试构建iOS应用程序。除了'格里高利'部分之外,所有东西(包括其他助推功能)都能正常工作。我已经使用了大量不同的方法来构建提升,但我仍然无法设法让这部分工作。

有什么方法可以让它发挥作用吗?

编辑:忘了提及,我已将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)

0 个答案:

没有答案