Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

floating point functions work? #104

Closed
kriswiner opened this issue Dec 18, 2016 · 3 comments
Closed

floating point functions work? #104

kriswiner opened this issue Dec 18, 2016 · 3 comments

Comments

@kriswiner
Copy link

I inserted this function into a sketch that compiles and runs with no problem:

float test = 145366.45f*(1.0f - powf((VBAT/1013.25f), 0.190284f));

where VBAT is a float measured using analogRead.

The sketch does not compile and returns this error:

C:\Users\kris\Documents\Arduino\hardware\espressif\ESP32/tools/sdk/lib\libm.a(lib_a-ef_pow.o):(.literal+0xbc): undefined reference to `__ieee754_sqrtf'

C:\Users\kris\Documents\Arduino\hardware\espressif\ESP32/tools/sdk/lib\libm.a(lib_a-ef_pow.o): In function `__ieee754_powf':

/home/ivan/freertos/smpemu/newlib/newlib_xtensa-2.2.0/xtensa-esp108-elf/newlib/libm/math/../../../.././newlib/libm/math/ef_pow.c:115: undefined reference to `__ieee754_sqrtf'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board ESP32 Dev Module.


Am I missing a library or something?

@issalig
Copy link

issalig commented Dec 20, 2016

Undefined reference normally points to a missing #include <math.h>
Also you should link to math library with flag -lm

Hope this helps.

@me-no-dev
Copy link
Member

the undefined reference above means that the methods mentioned are not implemented and not tha they are not defined :)
the flag -lm is already added. Seems that there are some methods that should be implemented in stdlib @igrr ?

@me-no-dev
Copy link
Member

compiles fine now :) closing this issue

brentru pushed a commit to adafruit/arduino-esp32 that referenced this issue Oct 22, 2024
make symlink with library name rather than 'Adafruit_Test_Library'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants