Compiling Error when including "time.h", MQX4.1, gcc

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Compiling Error when including "time.h", MQX4.1, gcc

583 Views
weapon
Senior Contributor I

Hi Folks,

I created a MQX project based on TWR-K60D100 GCC, and included "time.h" in. but there were some compiling errors . could you give me some hints about that. below is the screenshot.

pastedImage_0.png

0 Kudos
2 Replies

284 Views
DavidS
NXP Employee
NXP Employee

Hi Weiping,

I have some example code attached in zip to show how to setup the MQX time manually or to use an automated process that gets the time from a NTP (network time protocol) server or if that fails then to use the MQX RTOS compiled time/date to at least get a course time/date setting.

I had created a shell command "sh_oneshot.c" that goes in the following path:

C:\Freescale\Freescale_MQX_4_X\shell\source\rtcs

Hope this help you or others.

Regards,

David

0 Kudos

284 Views
danielchen
NXP TechSupport
NXP TechSupport

Unfortunately the time functions are not implemented  - This header file (time.h) is provided for compatibility only, the implementation is fully hardware dependent.

"The ANSI library provides several functions to get the current time. In an embedded systems environment, implementations for these functions cannot be provided because different targets may use different ways to count the time."

If you need it, you have to write your own functions (if you have some Real Time Clock component on your board).

0 Kudos