Windows Build failure

Robert Fewell 14ubobit at gmail.com
Fri Jul 24 09:09:34 EDT 2015


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.

Regards,

   Robert

On 24 July 2015 at 01:37, John Ralls <jralls at ceridwen.us> wrote:

>
> > On Jul 21, 2015, at 9:18 AM, John Ralls <jralls at ceridwen.us> wrote:
> >
> >
> >> On Jul 21, 2015, at 3:28 AM, Robert Fewell <14ubobit at gmail.com> wrote:
> >>
> >> John,
> >>
> >> I have found a better windows version of gdb and have set the break
> point and catch point as requested. Now running gnucash from gdb the
> exception stems from getting time zone information from
> gnc-timezone.cpp:240 as can be seen in attached image.
> >>
> >> Still trying to understand the c++ format but I think the registry keys
> are different in Windows XP to that of later versions as my XP does not
> have 'TimeZoneKeyName' used in windows_default_tzname.
> >>
> >
> > Robert,
> >
> > Hmm, the C version of that code in GLib and GC 2.4 doesn’t have a
> problem on XP, so I must have screwed something up when I ported it; it
> might just be throwing that exception, which is a bad idea since it can’t
> be caught in the way I’m using it. Since I can’t test on Windows until the
> weekend, if I can manage a patch before then I’ll send it to you to test.
> >
> > If you’re completely new to C++, Lipmann’s C++ Primer Plus is widely
> recommended.
>
> Robert,
>
> Here’s a first try at a patch. I can’t even test compile it until I get
> back tomorrow afternoon, but you can have a go at it and maybe fix any
> obvious typos.
>
> Regards,
> John Ralls
>
>


More information about the gnucash-devel mailing list