Actually, Windows does not support time () calls. Lib is not implemented,
It took three hours to find out today, a waste of time.
The current method is to call ctime: getcurrenttime () or Windows API getsystemtime ()
If you use time (time_t *), a classic time function written in VC ++, the compiler reports "error lnk2019: an external symbol that cannot be parsed _ imp_time, this symbol is in the function ...... "The error was found on Google for a long time and there was no progress. Finally, I found the answer in a foreign blog.
If u got the following error when trying to compile an windowce Application
"Error lnk2019: unresolved external symbol _ imp_time referenced in function"
That is because functions in time. H is not implemented on window ce.
The problem is described below:
"Since my last post was time related, why not another? Don't worry too much about why this is on a networking blog even though it has nothing to do with networking. I own this stuff since there's a lot of technology in CE and not a ton of developers, so we get to cover all sorts of ground. and I'm not inclined to create a "cetime" blog to cover time related functions on Ce: Smile :.
Once in a while I'm asked on a newsgroup or internally someone wants to use a UNIX style "time. H "function for whatever reason. the answer here is sorry, no, this isn't supported. in order to save resources (both ROM and Developer), we decided only to implement Win32 time related functions.
However, it's not quite that simple. we do ship time. h In % _ winceroot %/public/IE/SDK/Inc. this because some code we 've ported from the desktop needs the time related structures, though it obviously can't use the UNIX style functions declared in this file since they're not implemented anywhere. (the main data structure people use is TM, not to be confused with Toastmasters (which is a wonderful organization by the way ).)
This causes problems for developers who are using intelliisense. intelliisense sees the C runtime functions defined in time. H and doesn't realize that they're not implemented, so people write code that callinto them and their Code compiles but they get Link errors. understandably this is frustrating. the workaround here is obviusly not to trust intelliisense for this particle case. for future versions, we're looking at removing time. h from this source place or at a minimum removing all the unixy funxy like time (), gmtime (), localtime (), Etc... so intelliisense doesn' t get confused.
It turns out that time. h cannot be used in wince. Use ctime instead...