I got some problems when I build the project

I use the VSCode expansion, but the make programme seems not to dect the variable I changed(kp in the pic), so I need to set the build mode to “rebuild”, but it takes a long time to build (because I add LVGL Library to the project).Is there any better ways to slove this problem?

I believe this is because you have your variables defined in a header (.h) file. I’ve found that when the compiler tries to find files which you have changed it doesn’t always check header files. Try moving the definitions of your variables into a cpp file, which would always get checked. It looks like your variables are defined in a class, so you can assign their values inside of the constructor function of the class.

1 Like

Yeah I agree with @iseau395 probably the simplest solution is to move your KPI variables to your source file. Make doesn’t seem to pick up changes to headers file unless another source c/cpp file has been been modified or you rebuild your project from scratch.

I guess you could also try precompiling lvgl in a separate project and then just link against lgvl in your main project during the build. This would prevent you from having to rebuild lvgl every time you needed to rebuild your main project.

3 Likes