Hi Dialog
Our project uses a third party library that use math function, such as expf, exp, floorf, ceilf. When the project is compiled, there are some error, as bellow:
undefined reference to `floorf'
undefined reference to `ceilf'
undefined reference to `expf'
.....
Query mu question from Google, the result is that add the comile options "-lm" when the project is compiled.
Now, Where to add this compile options, Thanks.
Best Regards,
zhuxl
Device:
Hi zhuxi,
Are you using Keil ? This is something that you should check in keil support site, but i am able to include the math.h file and build the project.
Thanks MT_dialog
Hi MT_dialog
I use Dialog SmartSnippets Studio, I want to add some compile options.
I meet a problem when add "-fpu=None" compiled options. follow bellow:
/***start**************************/
make --silent pre-build main-build
Generate mem.ld for selected configuration (QSPI).
Building target: target.elf
Invoking: Cross ARM C Linker
arm-none-eabi-gcc.exe: error: unrecognized command line option '--fpu=None'
make: *** [target.elf] Error 1
/**************end******************/
Why the smartStudio can`t unrecognized command line option please. :)
PS: my product based on ARM Cotex-M0 CPU
Best Regards,
Zhuxl
Hi zhuxi,
As far as i can tell the --fpu=none is a command supported by keil compiler, in the case of the GNU tools the proper command for selecting an FPU is -mfpu which doesn't accept the 'none' as ab argument. Also you dont have to explicitly set the FPU, since its an ARM M0 it doens't have an FPU and the floating point operations are done via sw implementation.
Thanks MT_dialog