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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
722 Views
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

0 Kudos
1 Solution
616 Views
ErichStyger
Senior Contributor V

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

View solution in original post

0 Kudos
3 Replies
658 Views
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 Kudos
641 Views
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

 

0 Kudos
617 Views
ErichStyger
Senior Contributor V

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 Kudos