No announcement yet.

Access to pow() function (math.h)

  • Filter
  • Time
  • Show
Clear All
new posts

  • Access to pow() function (math.h)

    I think (from a previous thread) it was advisable not to #include standard C libraries as they'd conflict with the Evolution libraries.

    I need access to the pow() function found in the math.h library. Does Evolution provide an implementation of this function?

    Thanks, Duncan

  • #2
    Even tough this thread is old i'll just post my experiences so others looking for answers get some info:

    I've implemented the math.h header file without any problems, and have been able to use the pow() function.
    But later when i tried using the log function i got the error "undefined reference to 'log'.

    A search on goolge showed mee i should add -lm or -lmath somewhere for compilation (just haven't figured out where exactly i should place it in the evolution os :/) i'll update when i've found it.

    The resource found was this:
    I've tried adding -lm as a linker flag, since the console gives following msg:
    Linking cgi.out...
    work/cgi.o: In function `DDSCalcPow':
    C:\Program Files\Lantronix\Evolution XPort Pro SDK v5.2.0.0.R20\samples\xport_pro/../cgi.c:187: undefined reference to `log'
    collect2: ld returned 1 exit status
    What indicates the linker can't find the ref, but that didn't solve it...
    Last edited by Rob.Stoffels; 08-22-2011, 09:23 AM.