Hi,
I'm using uVision 3,23 with CA.exe (compiler) V2.41 and LA.exe (linker) 2.41. The program compiles, but with the linking run, I get errors;
*** WARNING L23: UNRESOLVED EXTERNAL SYMBOLS *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: mktime?T ADDRESS: 200023B4H
... :S. I've tried I guess everything. This error happens with the line:
time_t TIME; struct tm *ptim; /* the rest of my code... */ TIME = mktime(ptim)-0x3FF36300;
.
If I comment that line, the linker does the linkiing fine. The mktime() is declared in time.h, and the file is included. When I put the decleration in the local file; same error.. I don't know what to do anymore :S. Any ideas? The microcontroller is a STR7 and the code is for sync the hardware-RTC with the current time..
Thank you so so very much..
Jay.
Hm.
First; here's my story.. I wanted to use the rtc, and I didn't know how to use it, so I've searched for a C-example. I've found one and implemented it in my own code. Then I realised I needed time.h, which Keil didn't provide with uVision. I found one on the ST-forum, which is in ANSI-c and ARM-limited. And when I use it, I get no errors, no warnings, just an error with the linking stage....
I program in ANSII-C, I've checked, re-checked and double-checked all function names, variables arguments, structs, pointers, everything, I'm not using microlib and.. The linking-problem with mktime drives me crazy.. :S
Thnx.
Here is something to think about.
If you have written partial support yourself, you may have used a symbol name that is clashing with a symbol name of one of the object files in the library, this blocking the linker from linking in the object file that contains mktime().
I was in a hurry myself, so I never had the time to read how to get time() to work. I just created my own 1s interrupt for internal timing and when I need time, I use mktime() on this 1s variable. On startup, the initial value is loaded from the RTC.
I am trying to use the RTC of LPC2378 and the RTX kernel of KEIL.
After reading this thread, I started to study the mktime() and localtime().
The return value of localtime() looks strange to me. After some further study, I found another function, localtime_r(), "which is thread-safe and returns values in a user-supplied buffer instead of possibly using a static data area that may be overwritten by each call."
To define/reduce the Task stack size of RTX is difficult to someone like me. My question is: if I use localtime() in one Task, does it need larger Task stack size?
It seems that snprintf() needs a larger Task stack size. If this is true, then why? does snprintf() also use a static data area?