Cortex M4 on CW10 in Win7: How to build code with stricmp() support?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Cortex M4 on CW10 in Win7: How to build code with stricmp() support?

跳至解决方案
1,996 次查看
UnisvrTim
Contributor III

Hi! I am new in CW. I searched the forum but not get the answer.

 

I created a new basic application project with mfs and rtcs support. Then I just added the following lines:

if(stricmp("abc", "Def") == 0) {

  printf("match\n");

} else {

  printf("not match\n");

}

 

the problem is:

 

if I do not #include <extras/extras_string.h>, then it complains about stricmp not defined.

 

If I do include the extras, then it will complain about: _io_strcasecmp... redeclared as ..., and: was originally defined as ... etc.

 

How to solve this problem?

 

Thank you for your help!

 

best regards,

 

Tim

标签 (1)
0 项奖励
回复
1 解答
1,615 次查看
UnisvrTim
Contributor III

Just switched to CW10.2 and seems I can rebuild EWL as described.:smileyhappy:

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,615 次查看
CrasyCat
Specialist III

Hello

 

    stricmp is not an ANSI standard library function. It is part of the EWL extra library.

 

    So if you want to be able to use that function in your code you need to rebuild the EWL library with EWL Extras Library  

    enabled.

    Please refer to the EWL C Reference manual chapter Configuring EWL for more information on how  to

    Configure EWL Extra library.

 

   Note that you can import the project arm-cortexm_lib from folder {Install]\MCU\ARM_EABI_Support\ewl to rebuild the library.

 

CrasyCat

0 项奖励
回复
1,615 次查看
UnisvrTim
Contributor III

I cannot rebuild the EWL library :smileysad:

 

In CW10+MQX3.7, the EWL project imported from {Install]\MCU\ARM_EABI_Support\ewl is named as: EWL_C.prject. The only build configuration is: Coldfire Toolchain Tools and selecting Build Project will do nothing.

 

Am I forced to write my own "extras"?

 

0 项奖励
回复
1,616 次查看
UnisvrTim
Contributor III

Just switched to CW10.2 and seems I can rebuild EWL as described.:smileyhappy:

0 项奖励
回复
1,615 次查看
UnisvrTim
Contributor III

Thank you for the reply! I will try that right away.

 

best regards,

 

Tim

0 项奖励
回复