Description
Hi I want to use LVGL on Linux, I want to use it through framebuffer option and want to run on it. My LVGL version is 9.1
What MCU/Processor/Board and compiler are you using?
Ultimately I want to run LVGL on raspberry pi board, but before that I want to run on linux desktop through framebuffer. I am using gcc compiler and makefile.
What do you want to achieve?
I want to develop the GUI based on LVGL and also my raspberry pi will drive the hardware such as ADC and motors at backend.
What have you tried so far?
I have gone through all the LVGL documentation given and done the necessary steps which are showed. I have wrote one samll program and I have just called lv_init() function in main. When I compile it it shows me undefined reference to lv_init();
Code to reproduce
The code block(s) should be between ```c
and ```
tags:
/*You code here*/
#include <unistd.h>
#include "lvgl/lvgl.h"
int main(void)
{
/*LVGL init*/
lv_init();
// Linux frame buffer device init
// lv_display_t *display = lv_linux_fbdev_create();
// lv_linux_fbdev_set_file(display, "/dev/fb0");
// lv_example_get_started_1();
// Handle LitlevGL tasks (tickless mode)
/* while(1) {
lv_tick_inc(5);
lv_timer_handler();
usleep(5000);
}
*/
return 0;
}
/*You code ends here*/
Following is the output when I compiles the code
gcc main.c -o hello_world -Wall
/usr/bin/ld: /tmp/ccr8OWhh.o: in function `main':
main.c:(.text+0x9): undefined reference to `lv_init'
collect2: error: ld returned 1 exit status
make: *** [Makefile:10: all] Error 1
[date=2024-04-15 time=18:02:00 timezone="Asia/Calcutta"]
If I remove the lv_init(); function from main then program gets compiled.
Following is the makefile.
#make file - this is a comment section
CC=gcc #compiler
TARGET=hello_world #target file name
WARNING_FLAG=Wall
include lvgl/lvgl.mk
all:
$(CC) main.c -o $(TARGET) -$(WARNING_FLAG)
clean:
rm $(TARGET)
Following is the screen shot of directory structure, inside my project folder. Is this correct ?
![Screenshot from 2024-04-15 18-00-43|690x406](upload://Ac8QU0u6pV9rn8TBj05tA0ykJFE.png)
Please let me know where I am wrong.
Thanks in advance.