0
votes

I am having trouble using boost. I used the blue go application to install boost, and I included the boost libraries by opening up the property manager and including the boost libraries. There are no red squigleys, but when trying to compile an example from their website I get an error saying "fatal error LNK1104: cannot open file 'libboost_date_time-vc110-mt-gd-1_54.lib'"

This is the example I tried to do from this link (the days alive example)

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;

}

1

1 Answers

0
votes

You might be having wrong path for this boost library

Could use following as the library

-lboost_date_time-vc110-1_54

Look for corresponding library libboost_date_time-vc110-1_54 in your boost_1_54_0\stage\lib folder