title: LVGL functions not defined - why?
body: <p>I'm implementing a sample application on SeeedStudio's Wio Terminal with LVGL. I followed the LVGL's porting tutorial and came up with the following:</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &quot;lib\lvgl\lvgl.h&quot;
  #include &lt;SAMDTimerInterrupt.h&gt;
  #include &lt;SAMD_ISR_Timer.h&gt;
  #include &lt;TFT_eSPI.h&gt;
  
  // Defines --------------------------------------------------------------------
  
  #define DISPLAY_WIDTH (320)
  #define DISPLAY_HEIGHT (240)
  #define LVGL_TICK_PERIOD_MS (5)
  
  // Public variables -----------------------------------------------------------
  
  // TFT
  
  TFT_eSPI tft;
  
  // LVGL
  
  lv_disp_draw_buf_t lvgl_disp_buf;
  lv_color_t lvgl_buffer_1[DISPLAY_WIDTH * 10];
  lv_color_t lvgl_buffer_2[DISPLAY_WIDTH * 10];
  lv_disp_drv_t lvgl_disp_drv;
  lv_disp_t * lvgl_disp;
  
  lv_obj_t * screen;
  lv_obj_t * button;
  lv_obj_t * label; 
  
  // Timer
  
  SAMDTimer lvgl_timer(TIMER_TC3);
  
  // Public functions -----------------------------------------------------------
  
  void lvgl_flushDisplay(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
  {
    uint16_t c;
  
    tft.startWrite();                                                                            /* Start new TFT transaction */
    tft.setAddrWindow(area-&gt;x1, area-&gt;y1, (area-&gt;x2 - area-&gt;x1 + 1), (area-&gt;y2 - area-&gt;y1 + 1)); /* set the working window */
    for (int y = area-&gt;y1; y &lt;= area-&gt;y2; y++)
    {
      for (int x = area-&gt;x1; x &lt;= area-&gt;x2; x++)
      {
        c = color_p-&gt;full;
        tft.writeColor(c, 1);
        color_p++;
      }
    }
    tft.endWrite();            /* terminate TFT transaction */
    lv_disp_flush_ready(disp); /* tell lvgl that flushing is done */
  }
  
  void lvgl_tick()
  {
    lv_tick_inc(LVGL_TICK_PERIOD_MS);
  }
  
  // Arduino core functions -----------------------------------------------------
  
  void setup()
  {
    Serial.begin(9600); /* prepare for possible serial debug */
  
    // Initialize TFT
  
    tft = TFT_eSPI();
    tft.begin();        
    tft.setRotation(3); 
  
    // Initialize LVGL
  
    lv_init();
  
    lv_disp_draw_buf_init(&amp;lvgl_disp_buf, lvgl_buffer_1, lvgl_buffer_2, DISPLAY_WIDTH * 10);
  
    lv_disp_drv_init(&amp;lvgl_disp_drv);
    lvgl_disp_drv.draw_buf = &amp;lvgl_disp_buf;
    lvgl_disp_drv.hor_res = DISPLAY_WIDTH;
    lvgl_disp_drv.ver_res = DISPLAY_HEIGHT;
    lvgl_disp_drv.flush_cb = lvgl_flushDisplay;
    lvgl_disp = lv_disp_drv_register(&amp;lvgl_disp_drv);
  
    // Initialize timer for LVGL
  
    lvgl_timer.attachInterruptInterval(LVGL_TICK_PERIOD_MS * 1000, lvgl_tick);
  
    // Test interface
    screen = lv_obj_create(nullptr);
    button = lv_btn_create(screen);
    lv_obj_set_pos(button, 60, 10);
    lv_obj_set_size(button, 180, 30);
    // lv_obj_set_event_cb(button, buttonEventCallback);
    label = lv_label_create(button);
    lv_label_set_text(label, &quot;Przycisk&quot;);
    lv_scr_load(screen);
  }
  
  void loop()
  {
    lv_timer_handler();
  }
  </code></pre>
  <p>Note, that LVGL <strong>is present</strong> in the proper folder, lv_conf.h is configured properly etc.</p>
  <p>If I now try to build this project in Arduino IDE, I'm getting the following error:</p>
  <pre><code>sketch\WioStation.ino.cpp.o: In function `lvgl_flushDisplay(_lv_disp_drv_t*, lv_area_t const*, lv_color16_t*)':
  D:\Dokumenty\Arduino\WioStation/WioStation.ino:52: undefined reference to `lv_disp_flush_ready'
  sketch\WioStation.ino.cpp.o: In function `lvgl_tick()':
  D:\Dokumenty\Arduino\WioStation/WioStation.ino:57: undefined reference to `lv_tick_inc'
  sketch\WioStation.ino.cpp.o: In function `setup':
  D:\Dokumenty\Arduino\WioStation/WioStation.ino:74: undefined reference to `lv_init'
  D:\Dokumenty\Arduino\WioStation/WioStation.ino:76: undefined reference to `lv_disp_draw_buf_init'
  D:\Dokumenty\Arduino\WioStation/WioStation.ino:78: undefined reference to `lv_disp_drv_init'
  D:\Dokumenty\Arduino\WioStation/WioStation.ino:83: undefined reference to `lv_disp_drv_register'
  D:\Dokumenty\Arduino\WioStation/WioStation.ino:90: undefined reference to `lv_obj_create'
  D:\Dokumenty\Arduino\WioStation/WioStation.ino:91: undefined reference to `lv_btn_create'
  D:\Dokumenty\Arduino\WioStation/WioStation.ino:92: undefined reference to `lv_obj_set_pos'
  D:\Dokumenty\Arduino\WioStation/WioStation.ino:93: undefined reference to `lv_obj_set_size'
  D:\Dokumenty\Arduino\WioStation/WioStation.ino:95: undefined reference to `lv_label_create'
  D:\Dokumenty\Arduino\WioStation/WioStation.ino:96: undefined reference to `lv_label_set_text'
  sketch\WioStation.ino.cpp.o: In function `lv_scr_load':
  D:\Dokumenty\Arduino\WioStation\lib\lvgl\src\core/lv_disp.h:187: undefined reference to `lv_disp_load_scr'
  sketch\WioStation.ino.cpp.o: In function `loop':
  D:\Dokumenty\Arduino\WioStation/WioStation.ino:102: undefined reference to `lv_timer_handler'
  collect2.exe: error: ld returned 1 exit status
  Znaleziono wiele bibliotek w &quot;TFT_eSPI.h&quot;
  Wykorzystane: C:\Users\Spook\Documents\Arduino\libraries\TFT_eSPI
  Niewykorzystane: C:\Users\Spook\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.1\libraries\Seeed_Arduino_LCD
  exit status 1
  Błąd kompilacji dla płytki Seeeduino Wio Terminal.
  </code></pre>
  <p>What's surprising is that if I only comment out <code>#include</code>s with SAMDTimerInterrupt.h and SAMD_ISR_Timer.h, suddenly I'm getting no errors about LVGL anymore:</p>
  <pre><code>WioStation:32:1: error: 'SAMDTimer' does not name a type
   SAMDTimer lvgl_timer(TIMER_TC3);
   ^~~~~~~~~
  D:\Dokumenty\Arduino\WioStation\WioStation.ino: In function 'void setup()':
  WioStation:87:3: error: 'lvgl_timer' was not declared in this scope
     lvgl_timer.attachInterruptInterval(LVGL_TICK_PERIOD_MS * 1000, lvgl_tick);
     ^~~~~~~~~~
  D:\Dokumenty\Arduino\WioStation\WioStation.ino:87:3: note: suggested alternative: 'lvgl_tick'
     lvgl_timer.attachInterruptInterval(LVGL_TICK_PERIOD_MS * 1000, lvgl_tick);
     ^~~~~~~~~~
     lvgl_tick
  Znaleziono wiele bibliotek w &quot;TFT_eSPI.h&quot;
  Wykorzystane: C:\Users\Spook\Documents\Arduino\libraries\TFT_eSPI
  Niewykorzystane: C:\Users\Spook\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.1\libraries\Seeed_Arduino_LCD
  exit status 1
  'SAMDTimer' does not name a type
  </code></pre>
  <p>How do I see it is after including SAMDTimerInterrupt, suddenly lvgl is somehow not processed by the compiler.</p>
  <p>What am I doing wrong?</p>