Unable to compile using boost::date_time library

Discussion in 'C++' started by ufnuceda@gmail.com, Jan 14, 2006.

  1. Guest

    Hello everyone,

    I was wondering if any of you have some experience with the boost
    library. I am having trouble compiling code with it. Since boost is
    being used a lot these days I thought some of you might have an answer.
    I would greatly appreciate help with this, as I tried to search for an
    answer for quite some time in vain.

    I am getting error messages when I try to compile as soon as I put an
    include to the boost library in the code, even if I don't actually use
    the code anywhere (I did a test to see if my code wasn't breaking
    anything).

    This is the include I am using:

    #include "boost/date_time/local_time/local_time_types.hpp"

    as soon as I put it in my code (even if I don't have any other code
    refering to it), I get these errors:

    ------ Build started: Project: PackManNG, Configuration: Debug Win32
    ------
    Compiling...
    ConsoleController.cpp
    c:\codelibs\boost\boost_1_33_0\include\boost\date_time\time.hpp(63) :
    error C2146: syntax error : missing ')' before identifier 'sv'

    c:\codelibs\boost\boost_1_33_0\include\boost\date_time\time.hpp(180) :
    see reference to class template instantiation
    'boost::date_time::base_time<T,time_system>' being compiled
    c:\codelibs\boost\boost_1_33_0\include\boost\date_time\time.hpp(63) :
    error C2146: syntax error : missing ';' before identifier 'sv'
    c:\codelibs\boost\boost_1_33_0\include\boost\date_time\time.hpp(63) :
    error C2059: syntax error : ')'
    c:\codelibs\boost\boost_1_33_0\include\boost\date_time\time.hpp(64) :
    error C2065: 'sv' : undeclared identifier
    c:\codelibs\boost\boost_1_33_0\include\boost\date_time\time.hpp(64) :
    error C3861: 'time_': identifier not found
    c:\codelibs\boost\boost_1_33_0\include\boost\date_time\time.hpp(65) :
    error C4430: missing type specifier - int assumed. Note: C++ does not
    support default-int
    c:\codelibs\boost\boost_1_33_0\include\boost\date_time\time.hpp(65) :
    error C2473: 'sv' : looks like a function definition, but there is no
    parameter list.
    c:\codelibs\boost\boost_1_33_0\include\boost\date_time\time.hpp(66) :
    error C2146: syntax error : missing ';' before identifier 'base_time'
    c:\codelibs\boost\boost_1_33_0\include\boost\date_time\time.hpp(70) :
    fatal error C1903: unable to recover from previous error(s); stopping
    compilation

    c:\codelibs\boost\boost_1_33_0\include\boost\date_time\posix_time\ptime.hpp(32)
    : see reference to class template instantiation
    'boost::date_time::base_time<T,time_system>' being compiled
    with
    [
    T=boost::posix_time::ptime,
    time_system=boost::posix_time::posix_time_system
    ]
    Build log was saved at "file://c:\Documents and Settings\pendisch\My
    Documents\Visual Studio 2005\Projects\PackManNG\Debug\BuildLog.htm"
    PackManNG - 9 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
    ==========

    The first error points to time.h, and at line 63, this is what is
    written:

    base_time(special_values sv) :
    time_(time_system::get_time_rep(sv))
    {}

    My interpretation of errors is limited, but it seems to me that the
    compiler doesn't recognize the type "special_values", but I have no
    idea why. I put the include to the boost library correctly in the
    include directories list for the compiler and also the lib for boost is
    correctly listed in the linker.

    This is my environment:

    Windows XP, SP2, with BOTH VC++ 2003 (7.1) and VC++ 2005 (8.0). I
    compiled boost with the VC++ 2005, using the bjam command as follows:

    I downloaded the boost-jam-3.1.11-1-ntx86.zip, and use the bjam from
    that, and then
    compiled boost with the command line bjam "-sTOOLS=vc-8_0" install

    I got quite a few warnings, but nothing that wouldn't compile. Mainly
    about using deprecated STL keywords and the such. Otherwise it all
    compiled and I got all the different version of static and dynamic
    libraries.

    Any help would be greatly appreciated
    , Jan 14, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roman Yakovenko
    Replies:
    0
    Views:
    285
    Roman Yakovenko
    Nov 30, 2005
  2. Nagaraj
    Replies:
    1
    Views:
    856
    Lionel B
    Mar 1, 2007
  3. desktop

    How to get boost date_time?

    desktop, Jun 14, 2007, in forum: C++
    Replies:
    2
    Views:
    323
    Gavin Deane
    Jun 14, 2007
  4. =?ISO-8859-2?Q?Miros=B3aw?= Makowiecki

    The boost.variant library and boost::make_recursive_variant

    =?ISO-8859-2?Q?Miros=B3aw?= Makowiecki, Jul 5, 2007, in forum: C++
    Replies:
    1
    Views:
    702
    dasjotre
    Jul 6, 2007
  5. Mark
    Replies:
    3
    Views:
    847
    James Kanze
    Jul 19, 2007
Loading...

Share This Page