Windows Build failure
Robert Fewell
14ubobit at gmail.com
Sat Jul 25 05:55:35 EDT 2015
John,
Still no luck with your revised patch. There is no codecvt header file but
I did find one in bits/codecvt.h, tried adding that instead but still
failed, looked in that file and seemed to imply it should not be used
directly and maybe locale is the way to go.
Tried that and get the following error...
c:/gcdev/gnucash.git/src/libqof/qof/gnc-timezone.cpp: In member function
'void TimeZoneProvider::load_windows_default_tz
()':
c:/gcdev/gnucash.git/src/libqof/qof/gnc-timezone.cpp:241:5: error:
'wstring_convert' is not a member of 'std'
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>,char16_t>
conversion;
^
c:/gcdev/gnucash.git/src/libqof/qof/gnc-timezone.cpp:241:26: error:
'codecvt_utf8_utf16' is not a member of 'std'
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>,char16_t>
conversion;
^
c:/gcdev/gnucash.git/src/libqof/qof/gnc-timezone.cpp:241:50: error:
expected primary-expression before 'char16_t'
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>,char16_t>
conversion;
^
c:/gcdev/gnucash.git/src/libqof/qof/gnc-timezone.cpp:241:50: error:
expected ';' before 'char16_t'
c:/gcdev/gnucash.git/src/libqof/qof/gnc-timezone.cpp:242:21: error:
'conversion' was not declared in this scope
auto std_name = conversion.to_bytes(tzi.StandardName);
^
At global scope:
cc1plus.exe: error: unrecognized command line option
"-Wno-deprecated-register" [-Werror]
cc1plus.exe: all warnings being treated as errors
Attached are the changes I am currently using.
Regards,
Robert
On 24 July 2015 at 18:13, John Ralls <jralls at ceridwen.us> wrote:
>
> > On Jul 24, 2015, at 6:09 AM, Robert Fewell <14ubobit at gmail.com> wrote:
> >
> > John,
> >
> > Still trying to compile with your patch with the following changes for
> load_windows_default_tz...
> >
> > void
> > TimeZoneProvider::load_windows_default_tz()
> > {
> > TIME_ZONE_INFORMATION tzi {};
> > if (GetTimeZoneInformation (&tzi) == TIME_ZONE_ID_INVALID)
> > throw std::invalid_argument ("No default time zone.");
> > RegTZI regtzi { tzi.Bias, tzi.StandardBias, tzi.DaylightBias,
> tzi.StandardDate, tzi.DaylightDate };
> >
> > time_zone_names names (tzi.StandardName, tzi.StandardName,
> tzi.DaylightName, tzi.DaylightName);
> >
> > zone_vector.push_back(std::make_pair(0, zone_from_regtzi(regtzi,
> names)));
> > }
> >
> > and I also added this to hpp file line 63...
> >
> > void load_windows_default_tz(void);
> >
> > but am getting this error...
> >
> > c:/gcdev/gnucash.git/src/libqof/qof/gnc-timezone.cpp: In member function
> 'void TimeZoneProvider::load_windows_default_tz
> > ()':
> > c:/gcdev/gnucash.git/src/libqof/qof/gnc-timezone.cpp:237:98: error: no
> matching function for call to 'boost::date_time::
> > time_zone_names_base<char>::time_zone_names_base(WCHAR [32], WCHAR [32],
> WCHAR [32], WCHAR [32])'
> > time_zone_names names (tzi.StandardName, tzi.StandardName,
> tzi.DaylightName, tzi.DaylightName);
> >
>
> ^
> > c:/gcdev/gnucash.git/src/libqof/qof/gnc-timezone.cpp:237:98: note:
> candidates are:
> > In file included from
> c:/gcdev/boost/include/boost/date_time/local_time/custom_time_zone.hpp:12:0,
> > from
> c:/gcdev/boost/include/boost/date_time/local_time/local_time_types.hpp:18,
> > from
> c:/gcdev/boost/include/boost/date_time/local_time/local_time.hpp:13,
> > from
> c:/gcdev/gnucash.git/src/libqof/qof/gnc-timezone.hpp:34,
> > from
> c:/gcdev/gnucash.git/src/libqof/qof/gnc-timezone.cpp:23:
> > c:/gcdev/boost/include/boost/date_time/time_zone_names.hpp:59:5: note:
> boost::date_time::time_zone_names_base<CharT>::ti
> > me_zone_names_base(const string_type&, const string_type&, const
> string_type&, const string_type&) [with CharT = char; b
> > oost::date_time::time_zone_names_base<CharT>::string_type =
> std::basic_string<char>]
> > time_zone_names_base(const string_type& std_zone_name_str,
> > ^
> > c:/gcdev/boost/include/boost/date_time/time_zone_names.hpp:59:5: note:
> no known conversion for argument 1 from 'WCHAR
> > [32] {aka wchar_t [32]}' to 'const string_type& {aka const
> std::basic_string<char>&}'
> > c:/gcdev/boost/include/boost/date_time/time_zone_names.hpp:53:5: note:
> boost::date_time::time_zone_names_base<CharT>::ti
> > me_zone_names_base() [with CharT = char]
> > time_zone_names_base() :
> > ^
> > c:/gcdev/boost/include/boost/date_time/time_zone_names.hpp:53:5: note:
> candidate expects 0 arguments, 4 provided
> > c:/gcdev/boost/include/boost/date_time/time_zone_names.hpp:49:9: note:
> boost::date_time::time_zone_names_base<char>::tim
> > e_zone_names_base(const boost::date_time::time_zone_names_base<char>&)
> > class time_zone_names_base
> > ^
> > c:/gcdev/boost/include/boost/date_time/time_zone_names.hpp:49:9: note:
> candidate expects 1 argument, 4 provided
> > c:/gcdev/boost/include/boost/date_time/time_zone_names.hpp:49:9: note:
> boost::date_time::time_zone_names_base<char>::tim
> > e_zone_names_base(boost::date_time::time_zone_names_base<char>&&)
> > c:/gcdev/boost/include/boost/date_time/time_zone_names.hpp:49:9: note:
> candidate expects 1 argument, 4 provided
> > At global scope:
> > cc1plus.exe: error: unrecognized command line option
> "-Wno-deprecated-register" [-Werror]
> > cc1plus.exe: all warnings being treated as errors
> >
> > Will ponder further but you may beat me to an answer.
> >
>
> Robert,
>
> Ah, right, tzi.StandardName and tzi.DaylightName are wchar_t[] and boost
> doesn’t know what to do with them. This revised patch might work.
>
> Regards,
> John Ralls
>
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Subject-PATCH-Windows-Get-default-timezone-if-there-.patch
Type: text/x-patch
Size: 2836 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20150725/6dae7055/attachment.bin>
More information about the gnucash-devel
mailing list