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

ソリューションへジャンプ
1,213件の閲覧回数
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 解決策
1,107件の閲覧回数
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 返答(返信)
1,149件の閲覧回数
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 件の賞賛
返信
1,132件の閲覧回数
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 件の賞賛
返信
1,108件の閲覧回数
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 件の賞賛
返信