Questions and discussions about the software that runs on the TD RF module itself.
Walmore
 
Posts: 9
Joined: Mon Mar 13, 2017 2:11 am

undefined reference to `log'

by Walmore Wed Aug 22, 2018 7:59 am

Hi, there.
I'm trying to compile an algorithm that contains the "Log" function. I have included the Math.h library but when I try to compile it gives me the following error per console:
src\Lectura_Termistor.o: In function `Calculo':
Lectura_Termistor.c:(.text.Calculate+0x7e): undefined reference to `log'
collect2.exe: error: ld returned 1 exit status

Can you give some comment?
Best regards!
aoc
 
Posts: 8
Joined: Tue Aug 02, 2016 2:44 pm

Re: undefined reference to `log'

by aoc Fri Aug 24, 2018 8:28 am

Hi Walmore,

Under Eclipse, you need to right click on your project and go into Properties.

Then, you go in "C/C++ Build" > "Settings" and select "Libraries" under the "ARM Sourcery Windows GCC C Linker" section.
You click on the add icon on top right and enter "m" (without quotation marks) for the library to use.

Image
Walmore
 
Posts: 9
Joined: Mon Mar 13, 2017 2:11 am

Re: undefined reference to `log'

by Walmore Thu Aug 30, 2018 8:11 pm

I've already been able to fix it thanks to your information.
A new question, how do I print float variables on the screen which syntax indicator to use? i tried with "%f" but it doesn't show anything.
And how can I send a "float" variable by TD_SIGFOX_Send command to the sigfox backend?
Best regards.
cclerdan
 
Posts: 1
Joined: Mon Sep 03, 2018 12:08 pm

Re: undefined reference to `log'

by cclerdan Wed Sep 05, 2018 12:42 pm

Hi,

You can't print directly a float with the tfp_printf() function. It does not support float format.
I suggest that you print / send the value in hexa format and then do the conversion.
Or you can multiply the value in order to suppress the fractional part.

Regards,
Return to Firmware

Who is online

Users browsing this forum: No registered users and 1 guest