Linux编译LVGL仿真器出错问题解决
目录
- 一、错误现象
- 二、错误分析
- 三、错误解决
一、错误现象
我在虚拟机下使用 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

编辑文件,删除对应指令
vim make file

保存后程序编译

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

您可能感兴趣的文章
- 01-12Docker部署rabbitmq遇到的两个问题
- 01-12最新虚拟机VMware 14安装教程
- 01-12使用docker compose安装harbor私有仓库的详细教程
- 01-12Windows下Docker安装各种软件的详细过程
- 01-12seata docker 高可用部署的详细介绍
- 01-12浅谈Tomcat多层容器的设计
- 01-12Gogs+Jenkins+Docker 自动化部署.NetCore的方法步骤
- 01-12解决vscode docker插件docker.socket权限问题
- 01-12Docker中运行PostgreSQL并推荐几款连接工具
- 01-12Docker核心原理之 Cgroup详解


阅读排行
推荐教程
- 12-07一文教你怎么选择Tomcat对应的JDK版本
- 12-23linux中ftp无法访问怎么办
- 12-11docker存储目录迁移示例教程
- 12-10docker start启动容器后仍然exit状态的解决
- 12-10Linux下如何安装Logstash
- 12-05Docker安装Jenkins全过程
- 01-05Shell脚本去重的几种方法实例
- 12-22kvm虚拟机配置NAT端口转发的实现方法
- 12-19Zabbix SAML SSO 登录绕过漏洞的操作流程
- 12-15Docker-Compose搭建Spark集群的实现方法




