Linux编译LVGL仿真器出错问题解决

作者:JeckXu666 时间:2023-07-10 11:18:10 

一、错误现象

我在虚拟机下使用 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 编译器

Linux编译LVGL仿真器出错问题解决

unrecognized command line option ‘-Wshift-negative-value’ 提示无法识别指令,所以分析应该是 GCC 版本的原因,可能我的版本不支持这个指令,解决的方式就是换版本,或者删掉这个指令看能不能正常运行

三、错误解决

这里我先试试删除指令再编译,先用 grep 找到指令在文件的哪一行

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

Linux编译LVGL仿真器出错问题解决

编辑文件,删除对应指令

vim make file

Linux编译LVGL仿真器出错问题解决

保存后程序编译

Linux编译LVGL仿真器出错问题解决

编译成功,执行 demo,可以正常执行:

Linux编译LVGL仿真器出错问题解决

来源:https://blog.csdn.net/qq_45396672/article/details/122312696

标签:Linux,LVGL,仿真器
0
投稿

猜你喜欢

  • PR即将更新 大家做好准备

    2008-07-17 13:37:00
  • 站长买虚拟主机的被骗经历

    2008-06-04 12:52:00
  • 旅游网站推广攻略

    2009-03-04 14:26:00
  • 在ubuntu16.04上创建matlab的快捷方式(实现方法)

    2023-10-09 16:19:10
  • web集群服务的负载均衡方案选择与实现

    2010-04-04 18:39:00
  • 如何在本地同时架设ASP和PHP网站运行环境

    2008-05-27 12:42:00
  • 国外域名注册之新手指导

    2008-05-20 18:29:00
  • CentOS6.6安装CloudStack4.8

    2023-07-17 15:46:55
  • 网站运营模式观察与分析

    2009-01-07 12:47:00
  • 安全配置Windows 2003服务器远离脚本攻击

    2007-10-06 22:31:00
  • 分析用户需求:在场景中寻找"痛点"

    2011-01-25 12:24:00
  • SEO新手练兵手册

    2007-12-02 14:49:00
  • 我做盈利网站全过程

    2010-03-07 14:24:00
  • 美9月搜索市占Google微软上升 雅虎独憔悴

    2009-10-16 13:40:00
  • 微软发布Windows家庭服务器开发工具

    2007-04-23 15:07:00
  • windows 2003 iis 启用父路径方法

    2008-01-27 15:39:00
  • 我在谷歌面试回答“谷歌如何打败百度”

    2008-01-27 16:16:00
  • Win2K服务器端安全设置教程(2)

    2007-12-18 10:21:00
  • Qmail邮件服务器安装过程

    2007-03-27 09:49:00
  • centos 7中添加一个新用户并授权的步骤详解

    2023-08-29 03:26:02
  • asp之家 网站运营 m.aspxhome.com