Hi Bradley,
cctz works flawless now on Windows (as first tests are suggesting)!
As you said, compiling the tz database files with the 'zic' compiler did the job. Also setting the 'TZDIR' environment variable to tell cctz where to look for the tz database files works fine.
Greg and Bradley, many thanks for your help and again for your great cctz library!
Susan
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
For other novices like me, here is a short discription how to get the 'zic.exe' compiler for Windows:
1. Install 'Cygwin' on Windows
2. Get 'zic.exe' from 'cygwin' installation folder. For example c:\cygwin64\use\sbin
3. 'zic.exe' needs 'cygwin1.dll' in the same folder to work. Get it from c:\cygwin64\bin
4. Copy 'zic.exe' and 'cygwin1.dll' into your tz database files folder with the unzipped tz database archive files.
4. With 'zic.exe' now you can compile the database files one after another: For example 'zic.exe northamerica'.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Greg and Bradley,
if you like to optimise cctz for Windows a little further. This is the full list of Visual Studio 2015 C++ compiler warning messages:
You can suppress the 'error C4496' message by adding in front of your cc-files:
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
1. cctz_libc.cpp(61): error C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2. cctz_libc.cpp(65): error C4996: '__timezone': This function or variable may be unsafe. Consider using _get_timezone instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
3. cctz_libc.cpp(66): error C4996: '__tzname': This function or variable may be unsafe. Consider using _get_tzname instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
4. cctz_libc.cpp(69): error C4996: 'gmtime': This function or variable may be unsafe. Consider using gmtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
5. cctz_libc.cpp(120): warning C4244: "Initialising": Convert from "time_t" to "int", possible data lost
6. cctz_info.cpp(171): warning C4244: "Initialising": Convert from "int64_t" to "int", possible data lost
7. cctz_info.cpp(171): warning C4244: "Initialisierung": Convert from "int64_t" to "const int", possible data lost
8. cctz_info.cpp(437): warning C4267: "Argument": Convert from "size_t" to "long", possible data lost
9. cctz_info.cpp(652): error C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10. cctz_info.cpp(657): error C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
11. cctz_info.cpp(665): error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
12. cctz_info.cpp(743): warning C4244: "=": Convert from "int64_t" to "int", possible data lost
13. cctz_info.cpp(758): warning C4244: "=": Convert from "int64_t" to "int", possible data lost
14. src\cctz_info.cpp(760): warning C4244: "=": Convert from "int64_t" to "int", possible data lost
15. cctz_info.cpp(788): warning C4267: "Initialisierung": Convert from "size_t" to "int32_t", possible data lost
16. cctz_info.cpp(788): warning C4267: "Initialisierung": Convert from "size_t" to "const int32_t", possible data lost
17. cctz_info.cpp(823): warning C4244: "Argument": Convert from "__int64" to "int", possible data lost
18. cctz_info.cpp(834): warning C4267: "Initialisierung": Convert from "size_t" to "int32_t", possible data lost
19. cctz_info.cpp(834): warning C4267: "Initialisierung": Convert from "size_t" to "const int32_t", possible data lost
20. cctz_info.cpp(861): warning C4244: "Argument": Convert from "__int64" to "int", possible data lost
21. cctz_cnv.cpp(32): error C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.