1)I want to use "mktime" and "localtime" in my nrf52840 code ,how do i include time.h file?
2)I am using math.h file , in prj.conf i define "CONFIG_NEWLIB_LIBC=y" but I continuously get error as below ,how do i resolve it?
error:
1)I want to use "mktime" and "localtime" in my nrf52840 code ,how do i include time.h file?
2)I am using math.h file , in prj.conf i define "CONFIG_NEWLIB_LIBC=y" but I continuously get error as below ,how do i resolve it?
error:
No, you are going wrong
/usr/include its a system library, basic files which are used.
1) In sdk v2.3.0 file as below
/ncs/v2.3.0/modules/lib/hostap/src/utils/os_zephyr.c
In function
Hello Kumrita,
I am still not very sure that I understood you 100%, but here is what I have now.
Previously, I did not pay attention to the newlib_libc config.
So now, after having proper configs, I can use the mktime and localtime.
The catch is that we need to compile project first with these configs so that old files are not pulled and we could use the functions from the newlib.
Before compilation: can not use mktime
After compilation: can use mktime and localtime
Showing successful compilation with time.h and math.h
BR, Naeem
Hello Kumrita,
I am still not very sure that I understood you 100%, but here is what I have now.
Previously, I did not pay attention to the newlib_libc config.
So now, after having proper configs, I can use the mktime and localtime.
The catch is that we need to compile project first with these configs so that old files are not pulled and we could use the functions from the newlib.
Before compilation: can not use mktime
After compilation: can use mktime and localtime
Showing successful compilation with time.h and math.h
BR, Naeem
Thank you, this is what i want, my issue is resolved with this.