ModusToolBox IDE Linker Setting for Math Library Use

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
PICH_4397076
Level 3
Level 3
25 replies posted 10 replies posted 10 questions asked

Dear All,,,

I am using ModusToolbox with BTSDK 1.4.

To use math function, I included math.h, and -lm flags via IDE Project  properties.

During build, I got the following errors.

How can I add libm successfully?

c:/users/pilheon/modustoolbox_1.1/tools/gcc-7.2.1-1.0/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m\libm.a(lib_a-w_pow.o): In function `pow':

w_pow.c:(.text.pow+0x104): undefined reference to `__errno'

w_pow.c:(.text.pow+0x11e): undefined reference to `__errno'

w_pow.c:(.text.pow+0x17c): undefined reference to `__errno'

w_pow.c:(.text.pow+0x240): undefined reference to `__errno'

w_pow.c:(.text.pow+0x24a): undefined reference to `__errno'

collect2.exe: error: ld returned 1 exit status

make[1]: *** [BLE_Mesh_Dimmer_mainapp.elf] Error 1

make: *** [all] Error 2

Pls, let us know how to do!

Thanks,

0 Likes
1 Solution

Hi,

Not sure how well we can be expected to support issues with external libraries. Could you please try add the flag -lc also ?

As in the following link which looks close to your issue: http://pinguino.cc/forum/showthread.php?tid=4463

Thanks,

Anjana

View solution in original post

5 Replies