Boost logo

Boost Users :

From: Carl Waldbieser (yg-boost-users_at_[hidden])
Date: 2003-05-22 01:36:12


I recently tried some simple tests of the Boost date-time library (Boost
1.30.0 MSVC6) and ran into problems. I don't have the original code in
front of me (unfortunately I left it at work), but more or less, it looked
like this:

#include "boost/date_time/gregorian/gregorian.hpp"
#include <iostream>

int main()
{
 using namespace boost::gregorian;
 date today = day_clock::local_day();
 month_iterator it(today);
 std::advance(it, 3);
 std::string strDate(to_simple_string(*it));
 std::cout << "New date is " << strDate << std::endl;

 return 0;
}

The first problem I ran into was that I got a linker error because the class
greg_month (in greg_month.hpp) did not provide definitions for the following
member functions:

    const char* as_short_string() const;
    const char* as_long_string() const;

I quicky wrote some inline switch statements to get past that hurdle, but
then the compiler started complaining when I tried to use std::advance. It
is unfortunate that I do not have the exact error in front of me right now,
but I did trace the problem to the definition of month_iterator. I found
that if I derived its base implementation class from the class template
iterator that it would compile without problems. Is this a problem with the
STL that ships with MSVC6?

Anyway, I was wondering if maybe there was something I had not set up
correctly with my compiler that was causing me to get these errors. Any
help would be appreciated.

Carl Waldbieser
waldbie(at-sign-goes-here)attglobal.net


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net