AnsweredAssumed Answered

undefined reference to 'mktime'

Question asked by iscan on Feb 9, 2014
Latest reply on Feb 15, 2014 by iscan

I am unable to enable the mktime, localtime etc. functions.

 

This is what I have done:

1) I have opened the library project here: C:\Freescale\CW MCU v10.5\MCU\ARM_GCC_Support\ewl

2) Edited ansi-parms.h:

/* time and clock support */

     #ifndef _EWL_OS_TIME_SUPPORT

       #define _EWL_OS_TIME_SUPPORT 1        <---- this is the only thing I changed in the file.

     #endif

 

     #ifndef _EWL_CLOCK_T_AVAILABLE

       #define _EWL_CLOCK_T_AVAILABLE 1

     #endif

 

     #ifndef _EWL_TIME_T_AVAILABLE

       #define _EWL_TIME_T_AVAILABLE 1

     #endif

 

     #ifndef _EWL_TM_STRUCT_AVAILABLE

       #define _EWL_TM_STRUCT_AVAILABLE 1

     #endif

 

     #ifndef _EWL_TIME_T_IS_LOCALTIME

       #define _EWL_TIME_T_IS_LOCALTIME 1

     #endif

 

3) clean all

4) rebuild all.  Everything looks fine, no errors.

 

5) Then import my project again and clean/build. 

 

Same error. undefined reference to 'mktime' or whatever other time function I call.

The file date/time match the build time but the size of the libraries don't change.  I'm not sure how to rebuild the libraries to have the time (or other non-default) features enabled.

 

Does anyone have the same experience and a solution? Or just a solution? Direction?

 

Thanks in advance.

Ian

Outcomes