Difficulty getting examples to run


i am new to lvgl and am using an ESP32 devKit 3 board. I have downloaded lvgl from git and have created an Eclipse project. The demo project builds and runs fine. I would like to try and build some of the others in the examples folder. But I keep getting build errors.

I tried the sysmon example.
In lv_ex_conf.h I set LV_USE_DEMO to 0 and set LV_USE_SYSMON to 1

in app_main() I changed demo_create() to sysmon_create();

In main I added #include “lv_examples/lv_apps/sysmon/sysmon.h”

But I still get an undefined ref to sysmon_create

Anyone any ideas?



  1. Refresh the whole project by clicking on it in Project Explorer and pressing F5.
  2. Clean and rebuild.

Sometimes Eclipse fails to pick up on C files until you do the above steps. I’m thinking that might be the problem.

maybe u can try vs2019 instead.it’s cool.

Thanks embeddedt

Unfortunately it is still the same. I did see that the sysmon.h file starts with an #ifdef LV_USE_DEMO, and I have changed that to #ifdef LV_USE_SYSMON.

That removed the shading in eclipse so the IDE obviously can now see the header files contents and the void sysmon_create(void) is declared there.

I get no ‘file not found’ errors so the compiler is finding the header file correctly but for some reason doesn’t accept the declaration.

Anyway many thanks for your assistance


Add an #error testing statement inside sysmon.c and see if it fails to build.

I think it would be quite difficult to use bare-metal VS2019 for embedded development (besides possibly nanoFramework).

I used eclipse and vs ide. I think vs is more stable and easy to use, eclipse is prone to strange errors. And vs. no need to configure to use the LV library. For beginners, configuring eclipse in the win environment is a very difficult task.

Hi embeddedt

That was a good idea. I added ‘#error sysmon built OK’ next to the sysmon_create() function and got no hits on building the project. Still get the no ref to error.

Not quite sure where that leaves me now. The make file looks very similar to the one in the demo directory, and that builds OK.



So evidently Eclipse isn’t finding that file for some reason. Hmm…

AFAIK Eclipse generates its own private Makefiles. It doesn’t use the ones in the repository.

Where did you put the #error statement? If you move it to the first line of the file does it complain?

Hi embeddedt

It was just above the first active statement. but after the includes

Just tried again with it at the top of the file. before the includes and I still get no error from the error statement.

Both the lv_examples and the lvgl directories are in the component directory. It is a very recent download of esp32_ili9431. Demo which is also in the lv_examples directory builds fine.

hiVGL I do have VS but would not really want to move all the esp32 stuff to that, it is tricky enough to get it all working with eclipse. My ideal would be netbeans, it has a lot of useful features…

Thanks all


@Mark_F I’m quite puzzled by this now. I don’t see why it is refusing to build that file but the demo builds normally. Do any other examples work (i.e. lv_test_theme_1)?

Did you change any settings while you were getting it to work?

Hi embeddedT

I have just managed to get it to build. and I have flashed it to the esp32 and it run fine. I am sure this is not the correct way but might give some pointers…

So component.mk in lv_examples folder only lists lv_apps/demo as src. changed that to lv_app/sysmon.

Also I could not force an error if I added the error after the ifdef statement in the sysmon.c file. For now I have commented that out, so no test to see if LV_USE_SYSMON has been defined.

Checking lv_ex_conf.h and LV_USE_SYSMON = 1.

Thanks again for your help and I would appreciate the official way of doing this should you come across it



1 Like

I didn’t realize that Eclipse was using component.mk to decide what should be built (on other Eclipse-based IDEs I’ve used it generates its own Makefiles). That file probably needs to be updated.

At least I learned something about ESP32. :slightly_smiling_face:

lv_examples_components.mk is really not complete and it should be updated.