Linux編譯LVGL仿真器出錯(cuò)問題解決
一、錯(cuò)誤現(xiàn)象
我在虛擬機(jī)下使用 LVGL 仿真器,編譯仿真器源代碼時(shí)發(fā)生報(bào)錯(cuò)
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: *** 正在等待未完成的任務(wù).... 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
編譯無(wú)法進(jìn)行
二、錯(cuò)誤分析
根據(jù)提示分析錯(cuò)誤,其中 cc: error 提示報(bào)錯(cuò),翻到 Makefile 一看屬于 gcc 編譯器

unrecognized command line option ‘-Wshift-negative-value’ 提示無(wú)法識(shí)別指令,所以分析應(yīng)該是 GCC 版本的原因,可能我的版本不支持這個(gè)指令,解決的方式就是換版本,或者刪掉這個(gè)指令看能不能正常運(yùn)行
三、錯(cuò)誤解決
這里我先試試刪除指令再編譯,先用 grep 找到指令在文件的哪一行
grep -n "\-Wshift\-negative\-value" Makefile

編輯文件,刪除對(duì)應(yīng)指令
vim make file

保存后程序編譯

編譯成功,執(zhí)行 demo,可以正常執(zhí)行:

到此這篇關(guān)于Linux編譯LVGL仿真器出錯(cuò)問題解決的文章就介紹到這了,更多相關(guān)Linux LVGL仿真器出錯(cuò)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Windows下PHP安裝路徑配置錯(cuò)誤導(dǎo)致Apache無(wú)法啟動(dòng)的解決方法
這篇文章主要介紹了Windows下PHP安裝路徑配置錯(cuò)誤導(dǎo)致Apache無(wú)法啟動(dòng)的解決方法,本文可以說(shuō)是一個(gè)引號(hào)引發(fā)的悲劇,需要的朋友可以參考下2014-09-09
linux報(bào)錯(cuò)INFO:task?xxxxxx:634?blocked?for?more?than?120?
文章描述了一個(gè)Linux最小系統(tǒng)運(yùn)行時(shí)出現(xiàn)的“hung_task_timeout_secs”錯(cuò)誤,并探討了三種解決方案:縮小文件系統(tǒng)緩存大小、修改IO調(diào)度策略和取消120秒時(shí)間限制,通過測(cè)試,發(fā)現(xiàn)縮減文件系統(tǒng)緩存大小和取消120秒時(shí)間限制都可以解決問題2025-01-01
Apache使用.htaccess 屏蔽惡意 User Agent(防蜘蛛)
這篇文章主要介紹了Apache使用.htaccess 屏蔽惡意 User Agent(防蜘蛛),需要的朋友可以參考下2016-07-07

