NO

Author Topic: ANSI C tzset missing in 6.50 RC4 (and previous)  (Read 3334 times)

jphdumas

  • Guest
ANSI C tzset missing in 6.50 RC4 (and previous)
« on: February 17, 2012, 10:21:46 AM »
        polink ..\examples\clock.obj graphapp.lib user32.lib gdi32.lib -OUT:..\examples\clock.exe
POLINK: error: Unresolved external symbol '_tzset'.
POLINK: fatal error: 1 unresolved external(s).

tzset is ANSI C.

Greping in lib and include shows that it is completely absent.

How to overcome this ? Easily ?

Thanks.

iZzz32

  • Guest
Re: ANSI C tzset missing in 6.50 RC4 (and previous)
« Reply #1 on: February 17, 2012, 12:50:06 PM »
Quote
tzset is ANSI C.
Are you sure? At least C99 standard does not mention tzset at all (I didn't read C11 yet).

Quote
How to overcome this ? Easily ?
Link to msvcrt instead (not so easy) or maybe write your own tszet (use GetTimeZoneInformation to get data).

CommonTater

  • Guest
Re: ANSI C tzset missing in 6.50 RC4 (and previous)
« Reply #2 on: February 17, 2012, 02:16:16 PM »
_tzset() appears to be a Posiz (Linux/Unix) function that also appears in VC++ and GNU C++ libraries...
 
As iZzz32 has suggested you can use the Windows API calls...
 
SetTimeZoneInformation()   
 
and
 
GetTimeZoneInformation()   
 
Which are are available when you #include <windows.h>

By way of a quick hint... POIDE will syntax highligh library functions that appear in Pelles C... if it's not coloured it's likely not there.  To double check you can put your text cursor on the function name and press F1 on your keyboard... this will normally bring up help on the function, but if it fails the function is not likely part of C-99 or Pelles C extensions.
 

jphdumas

  • Guest
Re: ANSI C tzset missing in 6.50 RC4 (and previous)
« Reply #3 on: February 17, 2012, 04:32:46 PM »
Yes, sorry, It looks like tzset is not ANSI, but :  AES, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1


jphdumas

  • Guest
Re: ANSI C tzset missing in 6.50 RC4 (and previous)
« Reply #4 on: February 17, 2012, 04:40:33 PM »
And thanks for the pointer to SetTimeZoneInformation in the WinAPI, it will do.

Only regret : that tzset is not in the Pelles C library, that's the only windows compiler (C library) that does not have it, so far.
A not very expensive addition...

CommonTater

  • Guest
Re: ANSI C tzset missing in 6.50 RC4 (and previous)
« Reply #5 on: February 17, 2012, 05:49:46 PM »
And thanks for the pointer to SetTimeZoneInformation in the WinAPI, it will do.

Only regret : that tzset is not in the Pelles C library, that's the only windows compiler (C library) that does not have it, so far.
A not very expensive addition...

Yeah... not ANSI C-99 or C-98...

Well, FWIW... Pelles C supports a very nice static library system and it should be no problem to build your own private libraries for these things... tzset() would really just be a wrapper for the SetTimeZoneInformation() call... you could also do a tzget() function the same way.

If you jump over to the User Contribution forums, you'll find several libraries written by us lowly users... maybe you could add yours to the list.