Boost logo

Boost Users :

Subject: [Boost-users] Boost.date_time compilation error Debian GCC 4.3 Boost 1.35
From: Joost Kraaijeveld (J.Kraaijeveld_at_[hidden])
Date: 2009-03-10 06:44:33


I cannot get this short program to compile with GCC 4.3.2:

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

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

    boost::gregorian::date date = boost::gregorian::day_clock::local_day();
    std::cout << boost::gregorian::to_sql_string_type(date) << std::endl;

    return 0;

The error is:

g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Main.d" -MT"Main.d" -o"Main.o" "../Main.cpp"
../Main.cpp: In function ‘int main(int, char**)’:
../Main.cpp:18: error: no matching function for call to ‘to_sql_string_type(boost::gregorian::date&)’

I cannot find any solution anywhere hence my question: what am I doing wrong, and more important, how can I get it working?

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at