lvgl / lvgl

Embedded graphics library to create beautiful UIs for any MCU, MPU and display type.
https://lvgl.io
MIT License
16.16k stars 3.17k forks source link

cpp fatal error: ../../src/themes/lv_theme_private.h: No such file or directory #6778

Open SalarAmirSalari opened 2 weeks ago

SalarAmirSalari commented 2 weeks ago

LVGL version

9.1.0 - 9.3.0

What happened?

I am encountering an issue with the LVGL library:

fatal error: ../../src/themes/lv_theme_private.h: No such file or directory
    1 | #include "../../src/themes/lv_theme_private.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: exit status 1

Everything is configured as explained in the LVGL documentation (including lv_conf.h and User_Setup.h). After checking the directory, the file exists, and I have no clue what is wrong (I am a beginner, btw).

I am getting this error on both Windows and Arch Linux, so I suspect it might be an issue with the library itself.

How to reproduce?

No response

amirmohammadrsa commented 2 weeks ago

Same issue

C47D commented 2 weeks ago

What file is the error on?

liamHowatt commented 2 weeks ago

Is it examples/styles/lv_example_style_14.c? It's a strange issue. I can't tell what's wrong. If you hadn't already tried on two different systems, I would've suggested doing a clean build.

bladerunner09 commented 2 weeks ago

Try correcting the file path.

include "../../src/themes/lv_theme_private.h" -> #include "../src/themes/lv_theme_private.h"

or

include "../../src/themes/lv_theme_private.h" -> #include "src/themes/lv_theme_private.h"

liamHowatt commented 2 weeks ago

Good idea! Also try #include "lvgl/src/themes/lv_theme_private.h" How are you building/compiling your project?

vwheeler63 commented 2 weeks ago

Forgive me if I am missing something, but from examples/styles/lv_example_style_14.c

#include "../../src/themes/lv_theme_private.h"

is actually a correct path. The only way to cause that error is if the file is actually not there.... This would not be hard to have happen since the file was only added a month ago. @SalarAmirSalari , when you look in your local lvgl/src/themes directory, is the lv_theme_private.h file actually there? If not, then you probably have a "snapshot" of LVGL before this file was created.

JeroenRegtien commented 2 weeks ago

I had the same problem. On my Mac OSC installation I had to edit the "example_style_14.c" file and insert an extra "../" in the path for "lv_theme_private.h". The error disappeared but then a new compilation error occurred for file "lv_example_scale_7.c". Same issue here, add an extra "../" in the path of header file "lvgl_private.h".

My lvgl demo for the gigadisplay shield then compiles again, but displays garbage on the screen. I am concerned the latest lvgl library release (I was using 9.2.0) is corrupt or hasn't been checked properly before release.

I reverted back to 9.0.0 and then had no compilation nor run time problems... I then moved to 9.1.0 and this worked fine too. So my suggestion is to avoid 9.2.0 until these errors are fixed. I have however no idea how to find that out...

liamHowatt commented 2 weeks ago

As vwheeler63 said, the most important question is: is the file in the directory it should be in? If it's not, are you using some kind of fork that was only partially updated to v9.2?

sanimalp commented 1 week ago

this would only happen if you copied examples into src? right?

The paths are correct in the files you are referring to, in the context of this repository. example_style_14.c and lv_example_scale_7.c have correct paths from the root of the repository, but if you copied your example folder into source, it would cause these problems. Your options are: remove the example folder from source, or fix the paths if you intend to keep the folder in src.

here is a prominent tutorial that suggests the copy of examples into src, as a possible source for this bug https://randomnerdtutorials.com/lvgl-cheap-yellow-display-esp32-2432s028r/

WirelessMind commented 1 week ago

same issue

liamHowatt commented 1 week ago

Thanks sanimalp.

You can use the examples by compiling them where they are and calling lv_example_style_14() from your code or you can move or repurpose the examples of course, but the include paths may need to be updated, as sanimalp said.

ouening commented 4 days ago

Same issue in vesion 9.2