Porting old C project (LPC1788) to MCUXpresso (Redlib) compiler fails to locate “wmemcmp” function

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

Porting old C project (LPC1788) to MCUXpresso (Redlib) compiler fails to locate “wmemcmp” function

跳至解决方案
987 次查看
Eugene723
Contributor II

Compiler can’t find “wchar.h” and “wctype.h” includes that don’t exist in “C:\NXP\MCUXpressoIDE_11.8.0_1165\ide\plugins\com.nxp.mcuxpresso.tools.win32_11.8.0.202306131047\tools\redlib\include” folder – the one where all other library headers are located.

These two header files do exist in “C:\NXP\MCUXpressoIDE_11.8.0_1165\ide\plugins\com.nxp.mcuxpresso.tools.win32_11.8.0.202306131047\tools\arm-none-eabi\include” folder though.

 

So, what is the difference between these two folders with header files and where in project settings do I specify which one to use? Can I use the latter when compiling for LPC1788 with Redlib?

 

Thank you,

 

Eugene

标记 (3)
0 项奖励
回复
1 解答
881 次查看
ErichStyger
Specialist I

Hi @Eugene723 ,

Redlib does not support wide characters, you have to select a library which supports it, for example newlib:

ErichStyger_0-1694016264011.png

I wrote about different library options here: https://mcuoneclipse.com/2023/01/28/which-embedded-gcc-standard-library-newlib-newlib-nano/

I hope this helps,

Erich

在原帖中查看解决方案

0 项奖励
回复
3 回复数
923 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Eugene723 

"Can I use the latter when compiling for LPC1788 with Redlib?"

->>Which lib does your old project used?

You can also send your project to me, I help to check on my side.

 

BR

Alice

0 项奖励
回复
906 次查看
Eugene723
Contributor II

Hi Alice,

The old project used expensive commercial toolchain, so we decided to port it to MCUXpresso.

Some .c files from old project contain the following statements:

#include <wctype.h>

#include <wchar.h>

so compiler errors:

fatal error: wctype.h: No such file or directory

although there are those files, but in different folder. Function "wmemcmp" is used in this way:

int diff = wmemcmp(a, b, a_count);

where "a" and "b" declared as "wchar_t *".

Declaration "wchar_t" comes from header "stdlib.h" located in "C:\NXP\MCUXpressoIDE_11.8.0_1165\ide\plugins\com.nxp.mcuxpresso.tools.win32_11.8.0.202306131047\tools\redlib\include" folder, but neither "wctype.h" nor "wchar.h" reside in that folder. Why?

 

Thank you,

 

Eugene

 

标记 (3)
0 项奖励
回复
882 次查看
ErichStyger
Specialist I

Hi @Eugene723 ,

Redlib does not support wide characters, you have to select a library which supports it, for example newlib:

ErichStyger_0-1694016264011.png

I wrote about different library options here: https://mcuoneclipse.com/2023/01/28/which-embedded-gcc-standard-library-newlib-newlib-nano/

I hope this helps,

Erich

0 项奖励
回复