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

MySQL InnoDB row_id boundary overflow verification method steps

background I talked to my classmates about a boun...

Examples of importing and exporting MySQL table data

This article describes the import and export oper...

Implementing a simple whack-a-mole game in JavaScript

This article shares the specific code for JavaScr...

Develop a vue component that encapsulates iframe

Table of contents 1. Component Introduction 2. Co...

Design theory: the basics of font design

<br />Words are the inevitable product of hu...

About the problem of vertical centering of img and span in div

As shown below: XML/HTML CodeCopy content to clip...

Introduction to install method in Vue

Table of contents 1. Globally registered componen...

Detailed explanation of three ways to import CSS files

There are three ways to introduce CSS: inline sty...

js canvas realizes random particle effects

This article example shares the specific code of ...

Problems with using multiple single quotes and triple quotes in MySQL concat

When dynamically concatenating strings, we often ...

Dynamically add tables in HTML_PowerNode Java Academy

Without further ado, I will post the code for you...

mysql obtains statistical data within a specified time period

mysql obtains statistical data within a specified...

JavaScript to achieve a simple page countdown

This article example shares the specific code of ...