2

I'm trying to build the Boost date_time library so I can link it in my Makefile. I'm in "libs/date_time/build" and see a lonely "Jamfile.v2", if I type jam I get:

Jamfile: No such file or directory
...found 7 target(s)...

I have no idea what to do now, I can't find anything about the date_time installation in the Boost documentation.

Here is the text in the document:

# Boost.date_time build and test Jamfile
#
#  Based on boost.python Jamfile
#
# To run all tests quietly: jam test
#
# Declares the following targets:
#   1. libboost_date_time, a static link library to be linked with all
#      Boost.date_time modules
#


project boost/date_time
    : requirements
        <define>DATE_TIME_INLINE
    <link>shared:<define>BOOST_ALL_DYN_LINK=1   
    <link>static:<define>BOOST_DATE_TIME_STATIC_LINK    
    : usage-requirements    
        <define>DATE_TIME_INLINE
        <link>shared:<define>BOOST_DATE_TIME_DYN_LINK=1
    : source-location ../src
    ;

# Base names of the source files for libboost_date_time
CPP_SOURCES = greg_month greg_weekday date_generators ;

lib boost_date_time : gregorian/$(CPP_SOURCES).cpp ;

boost-install boost_date_time ;

Thanks, Joe

J.Bet-Eivazi
  • 117
  • 3
  • 6
  • 1
    Did you ever figure out what `Jamfile.v2` is for? I'm in the same situation, except there appears to be a `.cpp` file that I need to build. – Michael Koval Jun 30 '15 at 01:07

2 Answers2

0

Never mind, I just found the doc: http://www.boost.org/doc/libs/1_52_0/more/getting_started/unix-variants.html

Apparently there is no need to build anything for datetime. Still having some issues but that will be for a different question.

Joe

J.Bet-Eivazi
  • 117
  • 3
  • 6
0

Just to help anyone else trying to use the date_time library. You don't need to build anything, just include the needed header files in your code. If you get this error though:

/usr/include/c++/4.6/boost/date_time/date_formatting.hpp:44: undefined reference to `boost::gregorian::greg_month::as_short_string() const'
/usr/include/c++/4.6/boost/date_time/date_formatting.hpp:49: undefined reference to `boost::gregorian::greg_month::as_long_string() const'

Just sudo into that file and comment out those lines. The document says that you need to write those functions yourself.

lakshayg
  • 1,923
  • 2
  • 19
  • 31
J.Bet-Eivazi
  • 117
  • 3
  • 6