Boost logo

Boost Users :

From: Franck Guillaud (f.guillaud_at_[hidden])
Date: 2007-02-25 05:38:46


Hello World,

I'm doing some experiments to use boost (1.33.1) under Win XP and with
MinGW (5.1.3) environment. Boost was compiled with bjam with no
particular options.

I'm facing some problems on linking with boost_date_time. Here is the
simple test program:

#include <iostream>
#include <string>
#include <boost/date_time/posix_time/posix_time.hpp>

using namespace std;
using namespace boost::posix_time;

int main (int argc, char** argv)
{
        char dummy;

        ptime d1(min_date_time);
        ptime d2(max_date_time);

        cout << "min:" << to_simple_string(d1) << endl;

        cout << "max:" << to_simple_string(d2) << endl;

        cin.get(dummy);

        return 0;
}

Compiling lines are :

g++ -DUSE_DATE_TIME_PRE_1_33_FACET_IO -I"E:\dev\boost_1_33_1" -O0 -g3
-Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o"main.o"
"../main.cpp"

g++ -L"E:\dev\boost_1_33_1\stage\lib" -o"TestBOOST.exe" ./main.o
-lboost_date_time-mgw-mt-d-1_33_1

I get the error (simplified output) :

E:/dev/boost_1_33_1/boost/date_time/gregorian/greg_weekday.hpp:
undefined reference to `boost::gregorian::greg_month::as_long_string()
const'

If I remove the lines with *to_simple_string*, I get no error.

 From the docs [*] it seems there may be a problem for streams support
for some compilers, so I tryed to define USE_DATE_TIME_PRE_1_33_FACET_IO
in my project, but with no effect. Does it needs to be done when
compiling boost ?

  Is there any other way to solve my link problem ?
  (appart not using string output for dates :-) )

  Thanks for any help.

  Franck,e-

[*]
http://www.boost.org/doc/html/date_time/details.html#date_time.buildinfo


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