472,794 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,794 software developers and data experts.

Unable to compile using boost::date_time library

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
0 2427

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: KPB | last post by:
If I were to post code here that included stuff from *boost*, would the code get gigged for non-StdC++ compliance. I would think yes but maybe *boost* is a bit of a gray area on this NG. ...
8
by: googlebart2000 | last post by:
I'm about to be a new user of the Boost C++ library, and I've installed and compiled it, but I've come up empty on how to use it in my C++ programs. I can't find the documentation that explains...
2
by: Jens Hibbeler | last post by:
Hello, I am trying to compile the Boost library with the Borland Builder 6 enviorement. But it seems that it is not possible to use the Thread library which is especealli important for me. Has...
1
by: stachurr | last post by:
Hello I'm new in C, And I want to compile program which use extern function. How to do it because I always got error. Undefined first referenced symbol ...
3
by: Andreas S. | last post by:
Hi, I don't any solution any more... I have written a small tool wich uses the boost library. It compiles fine, but I can't link it. I am on a Fedora Core 6 x86_64 system. The boost library is...
5
by: Sarath | last post by:
Hi All, I've created a new group for discussing about boost library. If you are interested please join with it http://groups.google.com/group/boost-library Thanks.
2
by: desktop | last post by:
I have downloaded boost throught synaptic to Ubuntu 7.04. But I don't have the folder date_time in my /usr/inculde/boost dir. How do I get date_time?
3
by: Mark | last post by:
I want to simply get the unix style epoch time (number of secs to now from Jan 01, 1970 UTC) for use as a timestamp to track the staleness of some objects. So I don't care about time zones or...
1
by: kundasang | last post by:
Hi. I just downloaded boost library from boost.org then build and I don't know what does binary precompiled means. Well, I have installed it and I using bloodshed Dev-Cpp compiler. <bThen,...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.