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" <jeff@crystalclearsoftware.com> To: "Boost Users mailing list" <boost-users@lists.boost.org> Sent: Wednesday, November 12, 2003 10:10 AM Subject: Re: [Boost-users] int64_t error line is
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<char, std::char_traits<char> >& << int64_t&' operator /tools/gcc3/include/g++-v3/bits/ostream.tcc:140: candidates are: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/ostream.tcc:177: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/ostream.tcc:115: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/std_ostream.h:99: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/std_ostream.h:110: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/std_ostream.h:114: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/std_ostream.h:125: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/ostream.tcc:267: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/std_ostream.h:140: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/ostream.tcc:292: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/std_ostream.h:231: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, unsigned char) [with _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/std_ostream.h:226: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, signed char) [with _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/ostream.tcc:575: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char) [with _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/std_ostream.h:215: std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, char) [with _CharT = char, _Traits = std::char_traits<char>] /home/gsuberri/boost/boost/date_time/posix_time/time_formatters.hpp: In function `std::string boost::posix_time::to_iso_string(boost::posix_time::time_duration)': /home/gsuberri/boost/boost/date_time/posix_time/time_formatters.hpp:74: ambiguous overload for `std::basic_ostream<char, std::char_traits<char> >& << int64_t&' operator /tools/gcc3/include/g++-v3/bits/ostream.tcc:140: candidates are: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/ostream.tcc:177: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/ostream.tcc:115: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/std_ostream.h:99: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/std_ostream.h:110: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/std_ostream.h:114: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/std_ostream.h:125: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/ostream.tcc:267: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/std_ostream.h:140: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/ostream.tcc:292: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char, _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/std_ostream.h:231: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, unsigned char) [with _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/std_ostream.h:226: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, signed char) [with _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/ostream.tcc:575: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char) [with _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/std_ostream.h:215: std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, char) [with _CharT = char, _Traits = std::char_traits<char>] /home/gsuberri/boost/boost/lexical_cast.hpp: In member function `bool boost::detail::lexical_stream<Target, Source>::operator>>(InputStreamable&) [with InputStreamable = int64_t, Target = int64_t, Source = std::basic_string<char, std::char_traits<char>, std::allocator<char> >]': /home/gsuberri/boost/boost/lexical_cast.hpp:189: instantiated from `Target boost::lexical_cast(Source) [with Target = int64_t, Source = std::basic_string<char, std::char_traits<char>, std::allocator<char> >]' /home/gsuberri/boost/boost/date_time/time_parsing.hpp:47: instantiated from `time_duration boost::date_time::parse_delimited_time_duration(const std::string&) [with time_duration = boost::posix_time::time_duration]' /home/gsuberri/boost/boost/date_time/posix_time/time_parsers.hpp:18: instantiated from here /home/gsuberri/boost/boost/lexical_cast.hpp:149: no match for `std::basic_stringstream<char, std::char_traits<char>, std::allocator<char>
& >> 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<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char*) [with _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/std_istream.h:254: std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char*) [with _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/std_istream.h:245: std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&) [with _Traits = std::char_traits<char>] /tools/gcc3/include/g++-v3/bits/std_istream.h:240: std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&) [with _Traits = std::char_traits<char>]
----- Original Message ----- From: "Jeff Garland" <jeff@crystalclearsoftware.com> To: "Boost Users mailing list" <boost-users@lists.boost.org> Sent: Wednesday, November 12, 2003 12:16 PM Subject: Re: [Boost-users] int64_t error
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