githubで取得したプログラムをVSCode + platformioでビルドするとエラーがでる。
Q&A
Closed
解決したいこと
現在、VSCode + platformioでESP32用のプログラムを行えるようにできるように勉強中です。
現在ESP32に接続したタッチパネルTFT(ili9488)のためのタッチ操作ができるようにするためのサンプルプログラムをgithubなどで探したところ、LVGLというサンプルプログラムを見つけました。
LVGL Widgets Demo GUI on STM32F769 Discovery (800 x 480) https://youtu.be/I5iTb9AkY2w @YouTubeより
https://github.com/lvgl/lv_examples/tree/master/src/lv_demo_widgets
このプロジェクトからもらえる
・lv_demo_widgets.h
・lv_demo_widgets.c
このファイルを、platformio IDEの新規プロジェクトのsrcフォルダに追加したりしました。
githubに”lvglTest20201003”リポジトリとして作成。
https://github.com/KenjiMaehara/lvglTest20201003
発生している問題・エラー
とにかく、たくさんのエラーが出てきます。
これらのエラーを回避することは可能でしょうか?
> Executing task: C:\Users\kmaeh\.platformio\penv\Scripts\platformio.exe run <
Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (2.0.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 3.10004.200129 (1.0.4)
- tool-esptoolpy 1.20600.0 (2.6.0)
- toolchain-xtensa32 2.50200.80 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 26 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\esp32dev\src\lv_demo_widgets.c.o
src\lv_demo_widgets.c:30:29: error: unknown type name 'lv_obj_t'
static void controls_create(lv_obj_t * parent);
^
src\lv_demo_widgets.c:31:28: error: unknown type name 'lv_obj_t'
static void visuals_create(lv_obj_t * parent);
^
src\lv_demo_widgets.c:32:30: error: unknown type name 'lv_obj_t'
static void selectors_create(lv_obj_t * parent);
^
src\lv_demo_widgets.c:33:29: error: unknown type name 'lv_obj_t'
static void slider_event_cb(lv_obj_t * slider, lv_event_t e);
^
src\lv_demo_widgets.c:33:48: error: unknown type name 'lv_event_t'
static void slider_event_cb(lv_obj_t * slider, lv_event_t e);
^
src\lv_demo_widgets.c:34:25: error: unknown type name 'lv_obj_t'
static void ta_event_cb(lv_obj_t * ta, lv_event_t e);
^
src\lv_demo_widgets.c:34:40: error: unknown type name 'lv_event_t'
static void ta_event_cb(lv_obj_t * ta, lv_event_t e);
^
src\lv_demo_widgets.c:35:25: error: unknown type name 'lv_obj_t'
static void kb_event_cb(lv_obj_t * ta, lv_event_t e);
^
src\lv_demo_widgets.c:35:40: error: unknown type name 'lv_event_t'
static void kb_event_cb(lv_obj_t * ta, lv_event_t e);
^
src\lv_demo_widgets.c:36:22: error: unknown type name 'lv_task_t'
static void bar_anim(lv_task_t * t);
^
src\lv_demo_widgets.c:37:22: error: unknown type name 'lv_obj_t'
static void arc_anim(lv_obj_t * arc, lv_anim_value_t value);
^
src\lv_demo_widgets.c:37:38: error: unknown type name 'lv_anim_value_t'
static void arc_anim(lv_obj_t * arc, lv_anim_value_t value);
^
src\lv_demo_widgets.c:38:28: error: unknown type name 'lv_obj_t'
static void linemeter_anim(lv_obj_t * linemeter, lv_anim_value_t value);
^
src\lv_demo_widgets.c:38:50: error: unknown type name 'lv_anim_value_t'
static void linemeter_anim(lv_obj_t * linemeter, lv_anim_value_t value);
^
src\lv_demo_widgets.c:39:24: error: unknown type name 'lv_obj_t'
static void gauge_anim(lv_obj_t * gauge, lv_anim_value_t value);
^
src\lv_demo_widgets.c:39:42: error: unknown type name 'lv_anim_value_t'
static void gauge_anim(lv_obj_t * gauge, lv_anim_value_t value);
^
src\lv_demo_widgets.c:40:28: error: unknown type name 'lv_obj_t'
static void table_event_cb(lv_obj_t * table, lv_event_t e);
^
src\lv_demo_widgets.c:40:46: error: unknown type name 'lv_event_t'
static void table_event_cb(lv_obj_t * table, lv_event_t e);
^
src\lv_demo_widgets.c:52:8: error: unknown type name 'lv_obj_t'
static lv_obj_t * tv;
^
src\lv_demo_widgets.c:53:8: error: unknown type name 'lv_obj_t'
static lv_obj_t * t1;
^
src\lv_demo_widgets.c:54:8: error: unknown type name 'lv_obj_t'
static lv_obj_t * t2;
^
src\lv_demo_widgets.c:55:8: error: unknown type name 'lv_obj_t'
static lv_obj_t * t3;
^
src\lv_demo_widgets.c:56:8: error: unknown type name 'lv_obj_t'
static lv_obj_t * kb;
^
src\lv_demo_widgets.c:58:8: error: unknown type name 'lv_style_t'
static lv_style_t style_box;
^
src\lv_demo_widgets.c: In function 'lv_demo_widgets':
src\lv_demo_widgets.c:70:10: warning: implicit declaration of function 'lv_tabview_create' [-Wimplicit-function-declaration]
tv = lv_tabview_create(lv_scr_act(), NULL);
^
src\lv_demo_widgets.c:70:28: warning: implicit declaration of function 'lv_scr_act' [-Wimplicit-function-declaration]
tv = lv_tabview_create(lv_scr_act(), NULL);
^
src\lv_demo_widgets.c:70:42: error: 'NULL' undeclared (first use in this function)
tv = lv_tabview_create(lv_scr_act(), NULL);
^
src\lv_demo_widgets.c:70:42: note: each undeclared identifier is reported only once for each function it appears in
src\lv_demo_widgets.c:88:10: warning: implicit declaration of function 'lv_tabview_add_tab' [-Wimplicit-function-declaration]
t1 = lv_tabview_add_tab(tv, "Controls");
^
src\lv_demo_widgets.c:88:8: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
t1 = lv_tabview_add_tab(tv, "Controls");
^
src\lv_demo_widgets.c:89:8: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
t2 = lv_tabview_add_tab(tv, "Visuals");
^
src\lv_demo_widgets.c:90:8: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
t3 = lv_tabview_add_tab(tv, "Selectors");
^
src\lv_demo_widgets.c:93:5: warning: implicit declaration of function 'lv_style_init' [-Wimplicit-function-declaration]
lv_style_init(&style_box);
^
src\lv_demo_widgets.c:94:5: warning: implicit declaration of function 'lv_style_set_value_align' [-Wimplicit-function-declaration]
lv_style_set_value_align(&style_box, LV_STATE_DEFAULT, LV_ALIGN_OUT_TOP_LEFT);
^
src\lv_demo_widgets.c:94:42: error: 'LV_STATE_DEFAULT' undeclared (first use in this function)
lv_style_set_value_align(&style_box, LV_STATE_DEFAULT, LV_ALIGN_OUT_TOP_LEFT);
^
src\lv_demo_widgets.c:94:60: error: 'LV_ALIGN_OUT_TOP_LEFT' undeclared (first use in this function)
lv_style_set_value_align(&style_box, LV_STATE_DEFAULT, LV_ALIGN_OUT_TOP_LEFT);
^
src\lv_demo_widgets.c:95:5: warning: implicit declaration of function 'lv_style_set_value_ofs_y' [-Wimplicit-function-declaration]
lv_style_set_value_ofs_y(&style_box, LV_STATE_DEFAULT, - LV_DPX(10));
^
src\lv_demo_widgets.c:95:62: warning: implicit declaration of function 'LV_DPX' [-Wimplicit-function-declaration]
lv_style_set_value_ofs_y(&style_box, LV_STATE_DEFAULT, - LV_DPX(10));
^
src\lv_demo_widgets.c:96:5: warning: implicit declaration of function 'lv_style_set_margin_top' [-Wimplicit-function-declaration]
lv_style_set_margin_top(&style_box, LV_STATE_DEFAULT, LV_DPX(30));
^
src\lv_demo_widgets.c:98:5: warning: implicit declaration of function 'controls_create' [-Wimplicit-function-declaration]
controls_create(t1);
^
src\lv_demo_widgets.c:99:5: warning: implicit declaration of function 'visuals_create' [-Wimplicit-function-declaration]
visuals_create(t2);
^
src\lv_demo_widgets.c:100:5: warning: implicit declaration of function 'selectors_create' [-Wimplicit-function-declaration]
selectors_create(t3);
^
src\lv_demo_widgets.c: At top level:
src\lv_demo_widgets.c:113:29: error: unknown type name 'lv_obj_t'
static void controls_create(lv_obj_t * parent)
^
src\lv_demo_widgets.c:210:28: error: unknown type name 'lv_obj_t'
static void visuals_create(lv_obj_t * parent)
^
src\lv_demo_widgets.c:410:30: error: unknown type name 'lv_obj_t'
static void selectors_create(lv_obj_t * parent)
^
src\lv_demo_widgets.c:550:29: error: unknown type name 'lv_obj_t'
static void slider_event_cb(lv_obj_t * slider, lv_event_t e)
^
src\lv_demo_widgets.c:550:48: error: unknown type name 'lv_event_t'
static void slider_event_cb(lv_obj_t * slider, lv_event_t e)
^
src\lv_demo_widgets.c:567:25: error: unknown type name 'lv_obj_t'
static void ta_event_cb(lv_obj_t * ta, lv_event_t e)
^
src\lv_demo_widgets.c:567:40: error: unknown type name 'lv_event_t'
static void ta_event_cb(lv_obj_t * ta, lv_event_t e)
^
src\lv_demo_widgets.c:586:25: error: unknown type name 'lv_obj_t'
static void kb_event_cb(lv_obj_t * _kb, lv_event_t e)
^
src\lv_demo_widgets.c:586:41: error: unknown type name 'lv_event_t'
static void kb_event_cb(lv_obj_t * _kb, lv_event_t e)
^
src\lv_demo_widgets.c:600:22: error: unknown type name 'lv_task_t'
static void bar_anim(lv_task_t * t)
^
src\lv_demo_widgets.c:614:22: error: unknown type name 'lv_obj_t'
static void arc_anim(lv_obj_t * arc, lv_anim_value_t value)
^
src\lv_demo_widgets.c:614:38: error: unknown type name 'lv_anim_value_t'
static void arc_anim(lv_obj_t * arc, lv_anim_value_t value)
^
src\lv_demo_widgets.c:626:28: error: unknown type name 'lv_obj_t'
static void linemeter_anim(lv_obj_t * linemeter, lv_anim_value_t value)
^
src\lv_demo_widgets.c:626:50: error: unknown type name 'lv_anim_value_t'
static void linemeter_anim(lv_obj_t * linemeter, lv_anim_value_t value)
^
src\lv_demo_widgets.c:637:24: error: unknown type name 'lv_obj_t'
static void gauge_anim(lv_obj_t * gauge, lv_anim_value_t value)
^
src\lv_demo_widgets.c:637:42: error: unknown type name 'lv_anim_value_t'
static void gauge_anim(lv_obj_t * gauge, lv_anim_value_t value)
^
src\lv_demo_widgets.c:648:28: error: unknown type name 'lv_obj_t'
static void table_event_cb(lv_obj_t * table, lv_event_t e)
^
src\lv_demo_widgets.c:648:46: error: unknown type name 'lv_event_t'
static void table_event_cb(lv_obj_t * table, lv_event_t e)
^
src\lv_demo_widgets.c:56:19: warning: 'kb' defined but not used [-Wunused-variable]
static lv_obj_t * kb;
^
Compiling .pio\build\esp32dev\FrameworkArduino\cbuf.cpp.o
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-adc.c.o
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-bt.c.o
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-cpu.c.o
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-dac.c.o
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-gpio.c.o
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-i2c.c.o
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-ledc.c.o
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-matrix.c.o
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-misc.c.o
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-psram.c.o
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-rmt.c.o
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-sigmadelta.c.o
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-spi.c.o
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-time.c.o
*** [.pio\build\esp32dev\src\lv_demo_widgets.c.o] Error 1
============================================================= [FAILED] Took 2.22 seconds =============================================================The terminal process "C:\Users\kmaeh\.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
または、問題・エラーが起きている画像をここにドラッグアンドドロップ。
自分で試したこと
lvglのライブラリ関係のファイルが必要なのかな? と思い、
https://github.com/lvgl/lvgl
こちらのlvglのリポジトリファイルを、includeフォルダにすべて入れてみました。
ただ、lvgh.hをincludeしようとしてもできない現象が出てきます。
これらの回避方法などもご教示の程よろしくお願い致します。