How to use time.h and math.h in nrf connect sdk?

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:

/usr/include/math.h:415:33: error: '_Float128' is not supported on this target
415 | # define _Mdouble_ _Float128
Parents
  • Hello,

    I am not sure whether we are on the same page or not.

    I do not find any such folder /usr/include in the complete NCS folder.

    If that is custom implementation, then it makes sense.

    For such a case, I have created a custom library, it has a header file and a source file, very simple one just to show the functionality.

    The library I called neolib is present at c:/ncs/third_party/

    neolib has neolib.h and neolib.c files

    Below you can see I am using the header file (neolib.h) in my project

    I am using the function defined in it, and I can see everything is working good.

    BR, 
    Naeem

Reply
  • Hello,

    I am not sure whether we are on the same page or not.

    I do not find any such folder /usr/include in the complete NCS folder.

    If that is custom implementation, then it makes sense.

    For such a case, I have created a custom library, it has a header file and a source file, very simple one just to show the functionality.

    The library I called neolib is present at c:/ncs/third_party/

    neolib has neolib.h and neolib.c files

    Below you can see I am using the header file (neolib.h) in my project

    I am using the function defined in it, and I can see everything is working good.

    BR, 
    Naeem

Children
No Data
Related