cancel
Showing results for 
Search instead for 
Did you mean: 

What file we need to include to use" touchgfx ::Unicode::UnicodeChar " and strncpy

RG.3
Associate III

In my code when I am using touchgfx::Unicode::UnicodeChar it is showing expected an expression....What files should I include to solve this error

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III
#include <touchgfx/Unicode.hpp>

View solution in original post

12 REPLIES 12
Martin KJELDSEN
Chief III
#include <touchgfx/Unicode.hpp>

As soon as I include this file. I am getting many errors . I have to use "touchgfx ::Unicode::UnicodeChar" outside the touchgfx folder in order to display a char arrray....Can you please guide what should I do next?

Error[Pe020]: identifier "namespace" is undefined C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Types.hpp 79 
Error[Pe065]: expected a ";" C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Types.hpp 80 
Error[Pe169]: expected a declaration C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Types.hpp 153 
Error[Pe020]: identifier "class" is undefined C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Types.hpp 162 
Error[Pe065]: expected a ";" C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Types.hpp 163 
Error[Pe040]: expected an identifier C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Types.hpp 216 
Error[Pe099]: a declaration here must declare a parameter C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Types.hpp 216 
Error[Pe065]: expected a ";" C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Types.hpp 229 
Error[Pe130]: expected a "{" C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Types.hpp 374 
Error[Pe169]: expected a declaration C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Types.hpp 375 
Error[Pe077]: this declaration has no storage class or type specifier C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Types.hpp 458 
Error[Pe065]: expected a ";" C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Types.hpp 458 
Error[Pe169]: expected a declaration C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Types.hpp 713 
Error[Pe018]: expected a ")" C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Types.hpp 736 
Error[Pe168]: a function type is not allowed here C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Types.hpp 736 
Error[Pe065]: expected a ";" C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Types.hpp 737 
Error[Pe077]: this declaration has no storage class or type specifier C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Types.hpp 877 
Error[Pe065]: expected a ";" C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Types.hpp 877 
Error[Pe169]: expected a declaration C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Types.hpp 1012 
Error[Pe147]: declaration is incompatible with "__nounwind __interwork __vfp size_t strlen(char const *)"  C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\Unicode.hpp 68 
(declared at line 54 of "C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.3\arm\inc\c\string.h") 
Error[Pe147]: declaration is incompatible with "__nounwind __interwork __vfp char *strncpy(char *restrict,  C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\Unicode.hpp 88 
char const *restrict, size_t)" (declared at line 60 of "C:\Program Files (x86)\IAR Systems\Embedded  
Workbench 8.3\arm\inc\c\string.h") 
Error[Pe147]: declaration is incompatible with "__interwork __vfp uint16_t strncpy(uint16_t *, uint16_t const *,  C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\Unicode.hpp 108 
uint16_t)" (declared at line 88) 
Error[Pe147]: declaration is incompatible with "__interwork __softfp uint16_t *snprintf(uint16_t *, uint16_t,  C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\Unicode.hpp 252 
uint16_t const *, ...)" (declared at line 178) 
Error[Pe147]: declaration is incompatible with "__interwork __vfp uint16_t *vsnprintf(uint16_t *, uint16_t,  C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\Unicode.hpp 270 
uint16_t const *, va_list)" (declared at line 196) 
Error[Pe147]: declaration is incompatible with "__interwork __vfp uint16_t *snprintfFloats(uint16_t *, uint16_t,  C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\Unicode.hpp 433 
uint16_t const *, float const *)" (declared at line 320) 
Error[Pe247]: function "snprintfFloat" has already been defined (at line 370) C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\Unicode.hpp 495 
Error[Pe167]: argument of type "char const *" is incompatible with parameter of type "uint16_t const *" C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\Unicode.hpp 497 
Error[Pe147]: declaration is incompatible with "__nounwind __interwork __vfp int strncmp(char const *, char  C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\Unicode.hpp 521 
const *, size_t)" (declared at line 58 of "C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.3\ 
arm\inc\c\string.h") 
Error[Pe077]: this declaration has no storage class or type specifier C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\Unicode.hpp 577 
Error[Pe065]: expected a ";" C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\Unicode.hpp 577 
Error[Pe018]: expected a ")" C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\Unicode.hpp 580 
Error[Pe169]: expected a declaration C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\Unicode.hpp 583 
Error[Pe169]: expected a declaration C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\Unicode.hpp 584 
Error[Pe114]: function "snprintfFloats" was referenced but not defined C:\Users\SESA566532\Desktop\rishi\disp_arm\Middlewares\ST\touchgfx\framework\include\touchgfx\Unicode.hpp 320 
Error while running C/C++ Compiler

UnicodeChar is just typedeffed as uint16_t. I think you're including the file in some c-code. Keep TouchGFX code in cpp. What're you trying to do? I'm positive there's another way around it.

RG.3
Associate III

Yes Sir you are right. I am trying to print a unsigned char array (String) in touchgfx from an another C file. But In display it is reflecting as ????.So I went through your forums it was recommended to use strcpy to solve the issue.....That's why ? The hierarchy is I am sending the unsigned char array to wchar_t * and then I am printing it in screen (under touchgfx Files)

? means the characters are not generated by touchgfx. You need to put in any wildcard characters you want generated (so you dont have all glyphs from all your fonts creating a huge application).

RG.3
Associate III

0693W000006FKfxQAG.pngI have included in wildcard Characters. But still the problem exists

Check your generated files in generated/fonts source files - Are the unicodes there?

Did you make sure to invalidate the textarea after updating its wildcard buffer?

RG.3
Associate III

Problem Solved I understand. How it works....Thanks a ton sir!

Great! Let me know if you think there's something to improve in the documentation for better understanding. thanks.