openwch / arduino_core_ch32

Core library for CH32duino
218 stars 35 forks source link

Math function issue #55

Closed 42retfa closed 2 months ago

42retfa commented 4 months ago

Hello,

I'm testing arduino on the CH32V003 using platformio. I'm getting the. following error when I try to use mathematical functions like sin().

Linking .pio/build/ch32v003f4p6_evt_r0/firmware.elf
/Users/xxxxxx/.platformio/packages/toolchain-riscv/bin/../lib/gcc/riscv-none-embed/8.2.0/../../../../riscv-none-embed/bin/ld: .pio/build/ch32v003f4p6_evt_r0/src/main.cpp.o: in function `loop':
main.cpp:(.text.loop+0x3e): undefined reference to `sinf'

Is math.h supported yet ?

Thank you.

TianpeiLee commented 4 months ago

Maybe you can add the “-lm” option to the link and try it out. image