Boost logo

Boost Users :

From: Eric Crampton (ericcrampton_at_[hidden])
Date: 2003-02-25 08:15:10


I'm trying to test the date_time functionality of boost and am having some
difficulties. I would like to simply get the current local time into a ptime
and write it out as an ISO-8601 string.

Using Boost 1.29 and g++ 3.2, when I compile the following code I get a
number of *linker* errors.

Code:

#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/date_time/posix_time/time_formatters.hpp>

int main()
{
boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time();
std::cout << boost::posix_time::to_iso_extended_string(pt) << std::endl;
}

That code seems pretty straightforward to me. The linker errors look like
the following:

test.cpp:7: undefined reference to
`boost::date_time::gregorian_calendar_base<boost::date_time::year_month_day_base<boost::gregorian::greg_year,
boost::gregorian::greg_month, boost::gregorian::greg_day>, unsigned
long>::day_number(boost::date_time::year_month_day_base<boost::gregorian::greg_year,
boost::gregorian::greg_month, boost::gregorian::greg_day> const&)'

test.cpp:6: undefined reference to
`boost::date_time::gregorian_calendar_base<boost::date_time::year_month_day_base<boost::gregorian::greg_year,
boost::gregorian::greg_month, boost::gregorian::greg_day>, unsigned
long>::from_day_number(unsigned long)'

(snipped...)

Best as I can tell (cd $BOOST_ROOT/boost/date_time && find . -name '*.cpp'
-print), there are no .cpp files to be compiled...

Anyone know what's up?
--Eric

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


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