By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,799 Members | 1,362 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,799 IT Pros & Developers. It's quick & easy.

Unable to compile using boost::date_time library

P: n/a
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 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.