|
Boost Users : |
From: Hane, Christopher A (christopher.hane_at_[hidden])
Date: 2008-05-21 12:56:05
Hello,
I am trying to compile a simple example using the parsers and formatters
of the date_time library using g++ under Cygwin. I can successfully
build other boost examples passing only the include directory to g++,
but all date_time ones that I have tried fail.
#include <boost/date_time/gregorian/formatters.hpp>
#include <boost/date_time/gregorian/parsers.hpp>
#include <boost/date_time/gregorian/greg_date.hpp>
#include <iostream>
using namespace boost::gregorian;
int main()
{
std::string s("2001-10-9"); //2001-October-09
date d(from_simple_string(s));
std::cout << to_simple_string(d) << std::endl;
}
$g++ -I/usr/include/boost-1_33_1 -o example example.cpp
/cygdrive/c/DOCUME~1/USER/LOCALS~1/Temp/cc2nXx0a.o:example.cpp:(.text$_Z
N5boos
t9date_time19month_str_to_ushortINS_9gregorian10greg_monthEEEtSs[unsigne
d short
boost::date_time::month_str_to_ushort<boost::gregorian::greg_month>(std:
:basic_s
tring<char, std::char_traits<char>, std::allocator<char> >)]+0x102):
undefined r
eference to `boost::gregorian::greg_month::get_month_map_ptr()'
/cygdrive/c/DOCUME~1/USER/LOCALS~1/Temp/cc2nXx0a.o:example.cpp:(.text$_Z
N5boos
t9date_time15month_formatterINS_9gregorian10greg_monthENS0_13simple_form
atIcEEcE
12format_monthERKS3_RSo[boost::date_time::month_formatter<boost::gregori
an::greg
_month, boost::date_time::simple_format<char>,
char>::format_month(boost::gregor
ian::greg_month const&, std::basic_ostream<char, std::char_traits<char>
>&)]+0x3
8): undefined reference to
`boost::gregorian::greg_month::as_short_string() cons
t'
/cygdrive/c/DOCUME~1/USER/LOCALS~1/Temp/cc2nXx0a.o:example.cpp:(.text$_Z
N5boos
t9date_time15month_formatterINS_9gregorian10greg_monthENS0_13simple_form
atIcEEcE
12format_monthERKS3_RSo[boost::date_time::month_formatter<boost::gregori
an::greg
_month, boost::date_time::simple_format<char>,
char>::format_month(boost::gregor
ian::greg_month const&, std::basic_ostream<char, std::char_traits<char>
>&)]+0x5
7): undefined reference to
`boost::gregorian::greg_month::as_long_string() const
'
collect2: ld returned 1 exit status
Any clue what is going wrong here?
Thanks!
This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.
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