Connect to Wifi

I have esp32-c3 board.
Connecting to Wifi inside setup() gives following problem

/Users/dhruv.pandey/Library/Arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /private/var/folders/wr/p36s4cfn5n795mgpvn79xjb80000gp/T/arduino/sketches/3A25EF24A110925CD7D4E3E6EDDF8594/ui.ino.elf section `.dram0.bss' will not fit in region `dram0_0_seg'
/Users/dhruv.pandey/Library/Arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: DRAM segment data does not fit.
/Users/dhruv.pandey/Library/Arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: DRAM segment data does not fit.
/Users/dhruv.pandey/Library/Arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: region `dram0_0_seg' overflowed by 24128 bytes
collect2: error: ld returned 1 exit status
#include <WiFi.h>
void setup()
{
  WiFi.begin(ssid, password);

This is an ESP32 related problem and not something that has to do with LVGL. You will probably have better luck asking over at the ESP32 forum.