Boost.date_time compilation error Debian GCC 4.3 Boost 1.35
Hi,
I cannot get this short program to compile with GCC 4.3.2:
#include <iostream>
#include
Dear boosters, As a programmer under Unix-like systems, I really appreciate when a library (say `mylib') provides some `mylib-config' script that helps its users to build compiler flags. Several industrial strength libraries have such a tool: GSL, MySQL and, in the field of particle physics software I work: CLHEP, ROOT, CERNLIB... Here is an example for the GSL (GNU Scientific Library):
$ gsl-config Usage: gsl-config [OPTION]
Known values for OPTION are: --prefix show GSL installation prefix --libs print library linking information, with cblas --libs-without-cblas print library linking information, without cblas --cflags print pre-processor and compiler flags --help display this help and exit --version output version information <<< I makes really easy to write rather portable makefiles using things like: CPPFLAGS+=$(shell gsl-config --cflags) LDFLAGS+=$(shell gsl-config --lib) Up to now and AFAIK it seems Boost does not provide such script that could be generated at build stage for any system. I wrote my own script for my own usage (and for people who work with me). But at the end, I think it would be better to use an `official' tool. For my experience, it is also a strong argument to convince newbies to use Boost on top of standard C++, because it comes in some rather transparent way. So I have a few questions: - Is there such a script hidden in the Boost source tree? - If not, is there any plan to provide one? - Is someone else interested with it? Thank you very much for your comments [hope this topic has not been addressed in the past! I apologize in advance for that!] regards frc -- François Mauger Département de Physique - Université de Caen Basse-Normandie courriel/e-mail: mauger@lpccaen.in2p3.fr tél./phone: 02 31 45 25 12 / (+33) 2 31 45 25 12 fax: 02 31 45 25 49 / (+33) 2 31 45 25 49 Adresse/address: Laboratoire de Physique Corpusculaire de Caen (UMR 6534) ENSICAEN 6, Boulevard du Marechal Juin 14050 CAEN Cedex FRANCE
Francois Mauger
As a programmer under Unix-like systems, I really appreciate when a library (say `mylib') provides some `mylib-config' script that helps its users to build compiler flags. Several industrial strength libraries have such a tool: GSL, MySQL and, in the field of particle physics software I work: CLHEP, ROOT, CERNLIB...
Nowadays this practice has been superseded by pkg-config, but yes, I agree that these scripts are quite convenient.
Up to now and AFAIK it seems Boost does not provide such script that could be generated at build stage for any system. I wrote my own script for my own usage (and for people who work with me). But at the end, I think it would be better to use an `official' tool.
I think you should post your addition to the dev mailing list. I, for one, would like to see such a script distributed with a standard boost install. -tom
AMDG Joost Kraaijeveld wrote:
#include <iostream> #include
#include 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?
You need either to_sql_string_type<char>(date) or just to_sql_string(date) In Christ, Steven Watanabe
participants (4)
-
Francois Mauger
-
Joost Kraaijeveld
-
Steven Watanabe
-
tom fogal