when link newlib, there are an link error 'undefined reference to 'strnicmp''

Asked by XuXiaodong on 2018-03-20

Hi,
I use the new version(7.2.1) arm-none-eabi-gcc for my project, but I occur a problem, undefined reference to 'strnicmp' when linking, but I use 4.8.2 version is OK.

Have somebody met the issue same? Can you please provide me with any ideas on solving this issue?

Thanks very much!

best regards,
HaleyXu

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
Tejas Belagod
Solved:
2018-05-08
Last query:
2018-05-08
Last reply:
2018-03-20
Best Tejas Belagod (belagod-tejas) said : #1

Hi,

AFAICS, strnicmp isn't a C99 function. Try using strncasecmp() instead (though that isn't a C99 std string function either, and therefore is open to change).

Thanks,
Tejas.

XuXiaodong (haleyxu) said : #2

Hi,

Thanks for your reply!

 Well, using strncasecmp() is OK! I wonder that why 4.8.4 can use the API?

XuXiaodong (haleyxu) said : #3

Thanks Tejas Belagod, that solved my question.