Linux編譯LVGL仿真器出錯問題解決
一、錯誤現(xiàn)象
我在虛擬機下使用 LVGL 仿真器,編譯仿真器源代碼時發(fā)生報錯
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
保存后程序編譯
編譯成功,執(zhí)行 demo,可以正常執(zhí)行:
到此這篇關于Linux編譯LVGL仿真器出錯問題解決的文章就介紹到這了,更多相關Linux LVGL仿真器出錯內容請搜索本站以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持本站!
版權聲明:本站文章來源標注為YINGSOO的內容版權均為本站所有,歡迎引用、轉載,請保持原文完整并注明來源及原文鏈接。禁止復制或仿造本網站,禁止在非www.sddonglingsh.com所屬的服務器上建立鏡像,否則將依法追究法律責任。本站部分內容來源于網友推薦、互聯(lián)網收集整理而來,僅供學習參考,不代表本站立場,如有內容涉嫌侵權,請聯(lián)系alex-e#qq.com處理。