簡體   English   中英

gcc C ++鏈接器使“'X'類型與原始聲明不匹配”錯誤?

[英]gcc C++ Linker make “type of 'X' does not match original declaration” an error?

如何使以下鏈接器警告有關錯誤的extern聲明為錯誤? 我正在編譯和鏈接gcc版本4.8.3 Sourcery CodeBench

uilding目標:xxxxx.elf調用:Cross ARM C ++鏈接程序arm-none-eabi-g ++ -mcpu = cortex-m4 -mthumb -mfloat-abi = softfp -mfpu = fpv4-sp-d16 -O0 -fmessage-length = 0- ffunction-sections -fdata-sections -flto -g3 -T“ .. \\ config \\ stm32f4ems \\ STM32F407xG_CCM.ld” -Xlinker --gc-sections -Wl,-Map,“ rusefi.map” -Wl--Map,“ rusefi.map“ -mcpu = cortex-m4 -mthumb -g3...。

xxx.cpp:584:21:警告:“ afrMap”的類型與原始聲明不匹配[默認啟用]

extern fuel_Map3D_t afrMap;

我希望這不會成功,這樣我就不會再錯過這個問題了。

嘗試使用標志-Werror

從此鏈接

-Werror
Make all warnings into errors.

編輯:如果您想更具體,可以使用

-Werror=
Make the specified warning into an error. 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM