目录
一、错误征象
我在虚拟机下使用 LVGL 仿真器,编译仿真器源代码时发生报错
- 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: *** 正在等待未完成的任务....
- 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
复制代码
复制代码 二、错误分析
根据提示分析错误,其中 cc: error 提示报错,翻到 Makefile 一看属于 gcc 编译器
unrecognized command line option ‘-Wshift-negative-value’ 提示无法辨认指令,以是分析应该是 GCC 版本的原因,大概我的版本不支持这个指令,解决的方式就是换版本,大概删掉这个指令看能不能正常运行
三、错误解决
这里我先试试删除指令再编译,先用 grep 找到指令在文件的哪一行- grep -n "\-Wshift\-negative\-value" Makefile
复制代码
编辑文件,删除对应指令复制代码
生存后步伐编译
编译成功,实行 demo,可以正常实行:
到此这篇关于Linux编译LVGL仿真器堕落题目解决的文章就介绍到这了,更多相干Linux LVGL仿真器堕落内容请搜索脚本之家从前的文章或继承欣赏下面的相干文章盼望大家以后多多支持脚本之家! |