cancel
Showing results for 
Search instead for 
Did you mean: 

undeclared (first use in this function)...

pk84
Senior

Hello,

I am going crazy, I always get the error that the structure Lcd_Ctx is not declared, while it is clearly declared (by including "stm32h750b_discovery_lcd.h").

With F3 I can find the structure declaration.

If I change the file from .c to .cpp the error is gone...

See screenshot below:

0693W00000UoQm6QAF.png 

18 REPLIES 18
MA4
Associate III

I think it's in stm32h745i_discovery_lcd.h, line 234: "extern BSP_LCD_Ctx_t Lcd_Ctx[];"

then he calls his .h in his .c file

oh, now I see the problem, thank you.

In the 745 h-file the variable is declared with extern Lcd_Ctx, and in the 750 h-file with LcdCtx ...

0693W00000UoWqnQAF.png

pk84
Senior

I have another similar question:

Why the compiler does not find lvgl.h, see screenshot below:

0693W00000UoXINQA3.png

MA4
Associate III

You need to write #include "../lvgl/lvgl.h" because ../ means exit the folder where your .c is.

So you exit User then lvgl is in the same level

MA4
Associate III

Ok maybe I don't see well the picture, there is an other possibility

MA4
Associate III

Right click on your project then go to properties-> C/C++ General -> Paths ans symbols and watch if the path of your folder with .h is in the list

ok that works, great, anyway it is not logical for me, because .c has two folders on top...

Still another similar failure, see screenshot below. What's wrong here?

0693W00000UoXNSQA3.png 

MA4
Associate III

I guess you add .h in a folder without .h in previously, can you check the path like I said in the previous message ?

now it works, thank you very much at all.