Problem to install LVGL library

I want use the lgvl example for Arduino Portenta . After install it , during the code verification , I get the following error : Arduino:1.8.19 (Windows 10), Scheda:"Arduino Portenta H7, Main Core, 1MB M7 + 1MB M4, None"
LVGLDemo:12:10: fatal error: lvgl.h: No such file or directory
#include "lvgl.h"
^~~~~~~~
compilation terminated.

exit status 1

lvgl.h: No such file or directory

But the file is present in
libraries / lvgl/lvgl.h
Where is the problem ?
Thank you

So should the include be #include "lvgl/lvgl.h"

Hi @maurodoimi.

What is the full path?

It is expected that Arduino IDE should be able to find the library as long as it is installed under the libraries subfolder of your sketchbook folder.

The sketchbook folder location is configured via the Arduino IDE preferences:

  1. Select File > Preferences... from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Note the path that is shown in the "Sketchbook location" field of the dialog.
  3. Click the "Cancel" button.
    The "Preferences" dialog will close.

For example, my "Sketchbook location" preference is set to C:\Users\per\Documents\Arduino and I have the "lvgl" library installed at this folder:

C:\Users\per\Documents\Arduino\libraries\lvgl

Arduino IDE has no problem finding it.

When you use the Arduino IDE Library Manager to install the library, it is always installed at the correct location (unless you later change your "Sketchbook location" preference), so we normally don't need to thing about where the libraries are installed.

I’m going crazy!
In the preferences all is OK . IDE point to documents/Arduino where there is the folder lvgl and inside there is lvgl.h.
C:\users\39335\Documents\Arduino
Inside the Arduino I get the folder libraries/lvgl/lvgl.h
everything looks good but I get the same error

If i change the include like you suggest ( #include "lvgl/lvgl.h") I get also the same error

LVGLDemo:12:10: fatal error: lvgl/lvgl.h: No such file or directory
#include "lvgl/lvgl.h"
^~~~~~~~~~~~~
compilation terminated.
exit status 1
lvgl/lvgl.h: No such file or directory

Help !

The file lvgl.h is the following

/**
 * @file lvgl.h
 * Include all LVGL related headers
 */

#ifndef LVGL_H
#define LVGL_H

#ifdef __cplusplus
extern "C" {
#endif

/***************************
 * CURRENT VERSION OF LVGL
 ***************************/
#define LVGL_VERSION_MAJOR 8
#define LVGL_VERSION_MINOR 3
#define LVGL_VERSION_PATCH 0
#define LVGL_VERSION_INFO ""

/*********************
 *      INCLUDES
 *********************/

#include "src/misc/lv_log.h"
#include "src/misc/lv_timer.h"
#include "src/misc/lv_math.h"
#include "src/misc/lv_mem.h"
#include "src/misc/lv_async.h"
#include "src/misc/lv_anim_timeline.h"
#include "src/misc/lv_printf.h"

#include "src/hal/lv_hal.h"

#include "src/core/lv_obj.h"
#include "src/core/lv_group.h"
#include "src/core/lv_indev.h"
#include "src/core/lv_refr.h"
#include "src/core/lv_disp.h"
#include "src/core/lv_theme.h"

#include "src/font/lv_font.h"
#include "src/font/lv_font_loader.h"
#include "src/font/lv_font_fmt_txt.h"

#include "src/widgets/lv_arc.h"
#include "src/widgets/lv_btn.h"
#include "src/widgets/lv_img.h"
#include "src/widgets/lv_label.h"
#include "src/widgets/lv_line.h"
#include "src/widgets/lv_table.h"
#include "src/widgets/lv_checkbox.h"
#include "src/widgets/lv_bar.h"
#include "src/widgets/lv_slider.h"
#include "src/widgets/lv_btnmatrix.h"
#include "src/widgets/lv_dropdown.h"
#include "src/widgets/lv_roller.h"
#include "src/widgets/lv_textarea.h"
#include "src/widgets/lv_canvas.h"
#include "src/widgets/lv_switch.h"

#include "src/draw/lv_draw.h"

#include "src/lv_api_map.h"

/*-----------------
 * EXTRAS
 *----------------*/
#include "src/extra/lv_extra.h"

/*********************
 *      DEFINES
 *********************/

/**********************
 *      TYPEDEFS
 **********************/

/**********************
 * GLOBAL PROTOTYPES
 **********************/

/**********************
 *      MACROS
 **********************/

/** Gives 1 if the x.y.z version is supported in the current version
 * Usage:
 *
 * - Require v6
 * #if LV_VERSION_CHECK(6,0,0)
 *   new_func_in_v6();
 * #endif
 *
 *
 * - Require at least v5.3
 * #if LV_VERSION_CHECK(5,3,0)
 *   new_feature_from_v5_3();
 * #endif
 *
 *
 * - Require v5.3.2 bugfixes
 * #if LV_VERSION_CHECK(5,3,2)
 *   bugfix_in_v5_3_2();
 * #endif
 *
 */
#define LV_VERSION_CHECK(x,y,z) (x == LVGL_VERSION_MAJOR && (y < LVGL_VERSION_MINOR || (y == LVGL_VERSION_MINOR && z <= LVGL_VERSION_PATCH)))

/**
 * Wrapper functions for VERSION macros
 */

static inline int lv_version_major(void)
{
    return LVGL_VERSION_MAJOR;
}

static inline int lv_version_minor(void)
{
    return LVGL_VERSION_MINOR;
}

static inline int lv_version_patch(void)
{
    return LVGL_VERSION_PATCH;
}

static inline const char *lv_version_info(void)
{
    return LVGL_VERSION_INFO;
}

#ifdef __cplusplus
} /*extern "C"*/
#endif

#endif /*LVGL_H*/

At the beginning of the lvgl.h I see the code

/**
 * @file lvgl.h
 * Include all LVGL related headers
 */

It's correct or I must delete it ?
Maybe IDE "sees" that in the lvgl. h file another lvgl. h is required!

Please be very exact in your communications here on the forum. We need to know the exact path that is present in the "Sketchbook location" field of the Arduino IDE preferences, not a vague "documents/Arduino".

Keep in mind that we can't see what you see on your computer so the only information we have to work with is what you provide in your forum posts. If that information is unclear then we might miss something or waste time following false leads, which will make it take longer for you to get a solution to your problem.

Is 39335 the actual name of the folder, or is it something else?

I ask because there is a known bug where Arduino IDE is not able to find libraries that are installed under paths that contain non-ASCII characters (e.g., мікроконтролер). Sometimes we are prevented from identifying this as the cause of user reports because they change the path to something without problematic characters for the sake of protecting their privacy. If this is the case for you, it is fine if you don't want to share the real name of the folder, but we do need to know whether it contains any potentially problematic characters.

If the folder is really named 39335 then that is not the cause of the problem as this folder name and path don't contain any problematic characters and we can focus our efforts on other possible causes of the problem.

You are being vague again. Just tell us the full path instead of interpreting it into ambiguous prose.

Is the full and exact path this?:

C:\users\39335\Documents\Arduino\libraries/lvgl/lvgl.h

This is expected. Please change that line in your sketch code back to the original correct form:

#include "lvgl.h"

You don't need to delete it. It is a comment:

It doesn't have any functional effect on the program. Comments only serve to provide documentation for the humans reading the code. The compiler ignores the comment completely.

the path is C:\users\39335\Documents\Arduino\libraries/lvgl/lvgl.h where 39335 is the user name of my user windows.
However , I've installed 15 other libraries and all are working . Only lvgl not work !
I've installed lvgl by zip file using the sketch menu on Arduino IDE .
I try also with a simple sketch like this

#include <lvgl.h>

void setup() {
  lv_init();
}

void loop() {
  lv_task_handler(); 
  delay(5);
}

but I get again the error

lvgl.h: No such file or directory

Please try this:

  1. Delete the folder at the following path:
    C:\users\39335\Documents\Arduino\libraries\lvgl
    
    :warning: Please be careful when deleting things from your computer. When in doubt, back up!
  2. Select Sketch > Include Library > Manage Libraries... from the Arduino IDE menus.
    The "Library Manager" dialog will open.
  3. Wait for the update to finish, as indicated by the progress bar at the bottom of the "Library Manager" dialog.
  4. Type lvgl in the "Filter your search..." field.
  5. Press the Enter key.
  6. Scroll down through the list of libraries until you see the "lvgl" entry. Click on it.
    A menu and button will appear at the bottom of the entry.
  7. Click the "Install" button in the "lvgl" entry.
  8. Wait for the installation to finish.
  9. Click the "Close" button in the "Library Manager" dialog.
    The "Library Manager" dialog will close.

Now try compiling your sketch again. Do you still get the lvgl.h: No such file or directory error?

Now the problem is solved !
I did so .

  1. I've deleted manually the folder lvgl from the libraries and all the related files like lvgl config and other more
  2. I've downloaded from Arduino library reference ,the latest zip lvgl library . I did this because in the library manager was not available
  3. I installed it using the Arduino IDE from the sketch menu; add library from zip file
  4. I prepared the file lvgl_conf as the lvgl instructions .
  5. The file lvgl_conf has been placed in the Arduino libraries folder
  6. I have selected the Arduino Portenta H7 board from the IDE menu
  7. I have loaded the test code LVGL_Arduino from the IDE example menu and verified it
  8. Finally I got no mistakes

thanks for your help

I'm glad it is working now. Thank you for taking the time to post an update!

That is odd. The "lvgl" library is definitely in Library Manager:

But anyway, the important thing is that you managed to make a working installation of the library.