Re: [Boost-users] int64_t error
On Wed, 12 Nov 2003 08:42:08 -0500, Gilad Suberri wrote
Hi, I am compiling my projects on Solaris, using the latest version of the boost date_time library. All the gregorian examples compile and build fine, but when I try to compile posix_time ones I get this error:
...error details snipped... The version of gcc is 3.0.2. I do not get this compiler error when I use gcc 2.95.3, but I needed to use the newer version.
Any ideas? Thanks.
I suspect that somehow you are not getting boost::int64_t defined. Although looking at the logic in boost/config I'm not seeing why at the moment -- you might experiment with trying to make sure boost::int64_t is defined. I won't have a chance to look until later as I'm running out the door. Bottom
Thanks. It seems that I do not have the file "stdint.h", so in cstdint.hpp,
int64_t is defined in the last #else section (that goes with #ifdef
BOOST_HAS_STDINT_H).
When operators.hpp is included before this file (cstdint.hpp,) int64_t does
not get defined at all because this next statement from cstdint.hpp becomes
false:
# if defined(BOOST_HAS_LONG_LONG) && \
!defined(BOOST_MSVC) && !defined(__BORLANDC__) && \
(!defined(__GLIBCPP__) || defined(_GLIBCPP_USE_LONG_LONG)) && \
(defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) ||
defined(ULONGLONG_MAX))
When the include statements are switched around int64_t gets defined. This
is connected to posix_time_config.h where
"boost/date_time/time_duration.hpp" is included before
"boost/date_time/time_resolution_traits.hpp", which causes the above
problem. I switched the two include statements and I am not running into
that compiler error anymore, but I am not sure if that will cause other
compiler errrors. Hope some of this made sense, let me know what you think
or if I am missing anything. Thanks.
Gilad
----- Original Message -----
From: "Jeff Garland"
it should work with this compiler...
Jeff
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On Wed, 12 Nov 2003 11:52:11 -0500, Gilad Suberri wrote
Thanks. It seems that I do not have the file "stdint.h", so in cstdint.hpp, int64_t is defined in the last #else section (that goes with #ifdef BOOST_HAS_STDINT_H). When operators.hpp is included before this file (cstdint.hpp,) int64_t does not get defined at all because this next statement from cstdint.hpp becomes false:
# if defined(BOOST_HAS_LONG_LONG) && \ !defined(BOOST_MSVC) && !defined(__BORLANDC__) && \ (!defined(__GLIBCPP__) || defined(_GLIBCPP_USE_LONG_LONG)) && \ (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX))
When the include statements are switched around int64_t gets defined. This is connected to posix_time_config.h where "boost/date_time/time_duration.hpp" is included before "boost/date_time/time_resolution_traits.hpp", which causes the above problem. I switched the two include statements and I am not running into that compiler error anymore, but I am not sure if that will cause other compiler errrors. Hope some of this made sense, let me know what you think or if I am missing anything. Thanks.
Makes sense to me. I'll look into shifting the include order and doing a full retest. Thx, Jeff
Thanks. When I shift the order I get this error, does it have an easy fix?:
In file included from
/home/gsuberri/boost/boost/date_time/posix_time/posix_time.hpp:10,
from print_hours.cpp:20:
/home/gsuberri/boost/boost/date_time/posix_time/time_formatters.hpp: In
function `std::string
boost::posix_time::to_simple_string(boost::posix_time::time_duration)':
/home/gsuberri/boost/boost/date_time/posix_time/time_formatters.hpp:43:
ambiguous
overload for `std::basic_ostream & >> long long int&' operator
/tools/gcc3/include/g++-v3/bits/istream.tcc:76: candidates are:
std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT,
_Traits>::operator>>(std::basic_istream<_CharT,
_Traits>&(*)(std::basic_istream<_CharT, _Traits>&)) [with _CharT = char,
_Traits = std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/istream.tcc:85:
std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT,
_Traits>::operator>>(std::basic_ios<_CharT,
_Traits>&(*)(std::basic_ios<_CharT, _Traits>&)) [with _CharT = char,
_Traits
= std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/istream.tcc:94:
std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT,
_Traits>::operator>>(std::ios_base&(*)(std::ios_base&)) [with _CharT =
char,
_Traits = std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/istream.tcc:103:
std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT,
_Traits>::operator>>(bool&) [with _CharT = char, _Traits =
std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/istream.tcc:130:
std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT,
_Traits>::operator>>(short int&) [with _CharT = char, _Traits =
std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/istream.tcc:157:
std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT,
_Traits>::operator>>(short unsigned int&) [with _CharT = char, _Traits =
std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/istream.tcc:184:
std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT,
_Traits>::operator>>(int&) [with _CharT = char, _Traits =
std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/istream.tcc:211:
std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT,
_Traits>::operator>>(unsigned int&) [with _CharT = char, _Traits =
std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/istream.tcc:238:
std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT,
_Traits>::operator>>(long int&) [with _CharT = char, _Traits =
std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/istream.tcc:265:
std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT,
_Traits>::operator>>(long unsigned int&) [with _CharT = char, _Traits =
std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/istream.tcc:348:
std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT,
_Traits>::operator>>(float&) [with _CharT = char, _Traits =
std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/istream.tcc:375:
std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT,
_Traits>::operator>>(double&) [with _CharT = char, _Traits =
std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/istream.tcc:402:
std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT,
_Traits>::operator>>(long double&) [with _CharT = char, _Traits =
std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/istream.tcc:429:
std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT,
_Traits>::operator>>(void*&) [with _CharT = char, _Traits =
std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/istream.tcc:456:
std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT,
_Traits>::operator>>(std::basic_streambuf<_CharT, _Traits>*) [with _CharT
=
char, _Traits = std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/std_iomanip.h:202:
std::basic_istream<_CharT, _Traits>&
std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setw) [with
_CharT = char, _Traits = std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/std_iomanip.h:175:
std::basic_istream<_CharT, _Traits>&
std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setprecision)
[with _CharT = char, _Traits = std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/std_iomanip.h:113:
std::basic_istream<_CharT, _Traits>&
std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setbase)
[with
_CharT = char, _Traits = std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/std_iomanip.h:86:
std::basic_istream<_CharT, _Traits>&
std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setiosflags)
[with _CharT = char, _Traits = std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/std_iomanip.h:59:
std::basic_istream<_CharT, _Traits>&
std::operator>>(std::basic_istream<_CharT, _Traits>&,
std::_Resetiosflags)
[with _CharT = char, _Traits = std::char_traits<char>]
/tools/gcc3/include/g++-v3/bits/std_istream.h:259:
std::basic_istream ----- Original Message -----
From: "Jeff Garland" On Wed, 12 Nov 2003 11:52:11 -0500, Gilad Suberri wrote Thanks. It seems that I do not have the file "stdint.h", so in
cstdint.hpp, int64_t is defined in the last #else section (that goes
with #ifdef BOOST_HAS_STDINT_H). When operators.hpp is included
before this file (cstdint.hpp,) int64_t does not get defined at all
because this next statement from cstdint.hpp becomes false: # if defined(BOOST_HAS_LONG_LONG) && \
!defined(BOOST_MSVC) && !defined(__BORLANDC__) && \
(!defined(__GLIBCPP__) || defined(_GLIBCPP_USE_LONG_LONG)) && \
(defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) ||
defined(ULONGLONG_MAX)) When the include statements are switched around int64_t gets
defined. This is connected to posix_time_config.h where
"boost/date_time/time_duration.hpp" is included before
"boost/date_time/time_resolution_traits.hpp", which causes the above
problem. I switched the two include statements and I am not running into
that compiler error anymore, but I am not sure if that will cause other
compiler errrors. Hope some of this made sense, let me know what you
think or if I am missing anything. Thanks. Makes sense to me. I'll look into shifting the include order and doing a
full retest. Thx, Jeff
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Gilad Suberri
-
Jeff Garland