Solution to the error in compiling LVGL emulator on Linux

Solution to the error in compiling LVGL emulator on Linux

1. Error phenomenon

I am using the LVGL emulator in a virtual machine and an error occurs when compiling the emulator source code

 cc: error: unrecognized command line option '-Wshift-negative-value'
cc: error: unrecognized command line option '-Wshift-negative-value'
cc: error: unrecognized command line option '-Wshift-negative-value'
Building project file: lvgl/examples/widgets/chart/lv_example_chart_6.c
Makefile:45: recipe for target 'build/obj/lvgl/examples/widgets/list/lv_example_list_1.o' failed
make: *** [build/obj/lvgl/examples/widgets/list/lv_example_list_1.o] Error 1
make: *** Waiting for unfinished tasks....
Makefile:45: recipe for target 'build/obj/lvgl/examples/widgets/spinner/lv_example_spinner_1.o' failed
make: *** [build/obj/lvgl/examples/widgets/spinner/lv_example_spinner_1.o] Error 1
Makefile:45: recipe for target 'build/obj/lvgl/examples/widgets/led/lv_example_led_1.o' failed
make: *** [build/obj/lvgl/examples/widgets/led/lv_example_led_1.o] Error 1
cc: error: unrecognized command line option '-Wshift-negative-value'
Makefile:45: recipe for target 'build/obj/lvgl/examples/widgets/textarea/lv_example_textarea_3.o' failed
make: *** [build/obj/lvgl/examples/widgets/textarea/lv_example_textarea_3.o] Error 1
cc: error: unrecognized command line option '-Wshift-negative-value'
Makefile:45: recipe for target 'build/obj/lvgl/examples/widgets/textarea/lv_example_textarea_2.o' failed
make: *** [build/obj/lvgl/examples/widgets/textarea/lv_example_textarea_2.o] Error 1
cc: error: unrecognized command line option '-Wshift-negative-value'
cc: error: unrecognized command line option '-Wshift-negative-value'
Makefile:45: recipe for target 'build/obj/lvgl/examples/widgets/textarea/lv_example_textarea_1.o' failed
make: *** [build/obj/lvgl/examples/widgets/textarea/lv_example_textarea_1.o] Error 1
Makefile:45: recipe for target 'build/obj/lvgl/examples/widgets/checkbox/lv_example_checkbox_1.o' failed
make: *** [build/obj/lvgl/examples/widgets/checkbox/lv_example_checkbox_1.o] Error 1
cc: error: unrecognized command line option '-Wshift-negative-value'
Makefile:45: recipe for target 'build/obj/lvgl/examples/widgets/chart/lv_example_chart_6.o' failed
make: *** [build/obj/lvgl/examples/widgets/chart/lv_example_chart_6.o] Error 1
Compilation cannot proceed

2. Error Analysis

Analyze the error according to the prompts. The cc: error prompts an error. Turn to the Makefile and see that it belongs to the gcc compiler.

20220104214639

unrecognized command line option '-Wshift-negative-value' prompts that the command cannot be recognized, so the analysis should be due to the GCC version. Maybe my version does not support this command. The solution is to change the version or delete this command to see if it can run normally.

3. Error resolution

Here I will try to delete the command and then compile it. First use grep to find which line of the file the command is in

 grep -n "\-Wshift\-negative\-value" Makefile

20220104215405

Edit the file and delete the corresponding instructions

 vim make file 

20220104215518

Save and compile the program

20220104215531

The compilation is successful, and the demo can be executed normally:

20220104215607

This is the end of this article about solving the error problem of compiling LVGL emulator on Linux. For more relevant content about Linux LVGL emulator error, please search the previous articles of 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to create an independent Android emulator
  • How to quickly create an Android emulator
  • Detailed installation steps of LVGL PC emulator

<<:  Clever use of webkit-box-reflect to achieve various dynamic effects (summary)

>>:  How to force vertical screen on mobile pages

Recommend

CSS style to center the HTML tag in the browser

CSS style: Copy code The code is as follows: <s...

MySQL 8.0.13 installation and configuration method graphic tutorial under win10

I would like to share the installation and config...

Sample code for implementing two-way authentication with Nginx+SSL

First create a directory cd /etc/nginx mkdir ssl ...

MySQL uses frm files and ibd files to restore table data

Table of contents Introduction to frm files and i...

JS Canvas interface and animation effects

Table of contents Overview Canvas API: Drawing Gr...

Implementing WeChat tap animation effect based on CSS3 animation attribute

Seeing the recent popular WeChat tap function, I ...

CSS positioning layout (position, positioning layout skills)

1. What is positioning? The position attribute in...

Centos6.9 installation Mysql5.7.18 step record

Installation sequence rpm -ivh mysql-community-co...

Mini Program to Implement Text Circular Scrolling Animation

This article shares the specific code of the appl...

Code to display the contents of a txt book on a web page

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML ...

How to install ionCube extension using pagoda

1. First install the pagoda Installation requirem...

5 super useful open source Docker tools highly recommended

Introduction The Docker community has created man...

Reasons and solutions for MySQL selecting the wrong index

In MySQL, you can specify multiple indexes for a ...