1. 程式人生 > >keil 4.22 MDK 建工程時出現的重定義錯誤

keil 4.22 MDK 建工程時出現的重定義錯誤

在更新官方的STM32 官方庫3.5版本的函式庫後,建立工程時會出現諸多重定義錯誤,例如:

D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(23): error:  #256: invalid redeclaration of type name "s32" (declared at line 487 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(27): error:  #256: invalid redeclaration of type name "sc32" (declared at line 491 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(31): error:  #256: invalid redeclaration of type name "vs32" (declared at line 495 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(35): error:  #256: invalid redeclaration of type name "vsc32" (declared at line 499 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(39): error:  #256: invalid redeclaration of type name "u32" (declared at line 503 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(43): error:  #256: invalid redeclaration of type name "uc32" (declared at line 507 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(47): error:  #256: invalid redeclaration of type name "vu32" (declared at line 511 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(51): error:  #256: invalid redeclaration of type name "vuc32" (declared at line 515 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #101: "RESET" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #101: "SET" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #256: invalid redeclaration of type name "FlagStatus" (declared at line 519 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #256: invalid redeclaration of type name "ITStatus" (declared at line 519 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #101: "DISABLE" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #101: "ENABLE" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #256: invalid redeclaration of type name "FunctionalState" (declared at line 521 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #101: "ERROR" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #101: "SUCCESS" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #256: invalid redeclaration of type name "ErrorStatus" (declared at line 524 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_conf.h(147): warning:  #47-D: incompatible redefinition of macro "HSE_Value" (declared at line 528 of ".\CM3\stm32f10x.h")
user\main.c(30): error:  #20: identifier "GPIO_InitTypeDef" is undefined
user\main.c(53): warning:  #223-D: function "RCC_APB2PeriphClockCmd" declared implicitly
user\main.c(53): error:  #20: identifier "RCC_APB2Periph_GPIOB" is undefined
user\main.c(53): error:  #20: identifier "RCC_APB2Periph_GPIOD" is undefined
user\main.c(55): error:  #20: identifier "GPIO_Pin_5" is undefined
user\main.c(56): error:  #20: identifier "GPIO_Mode_Out_PP" is undefined
user\main.c(57): error:  #20: identifier "GPIO_Speed_50MHz" is undefined
user\main.c(58): warning:  #223-D: function "GPIO_Init" declared implicitly
user\main.c(60): error:  #20: identifier "GPIO_Pin_6" is undefined
user\main.c(60): error:  #20: identifier "GPIO_Pin_3" is undefined
user\main.c(66): error:  #20: identifier "GPIO_Pin_13" is undefined
user\main.c(70): warning:  #223-D: function "GPIO_ResetBits" declared implicitly
user\main.c(88): warning:  #223-D: function "GPIO_SetBits" declared implicitly
user\main.c(88): error:  #20: identifier "GPIO_Pin_5" is undefined
user\main.c(88): warning:  #223-D: function "GPIO_ResetBits" declared implicitly
user\main.c(88): error:  #20: identifier "GPIO_Pin_6" is undefined
user\main.c(88): error:  #20: identifier "GPIO_Pin_3" is undefined
compiling stm32f10x_rcc.c...
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(23): error:  #256: invalid redeclaration of type name "s32" (declared at line 487 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(27): error:  #256: invalid redeclaration of type name "sc32" (declared at line 491 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(31): error:  #256: invalid redeclaration of type name "vs32" (declared at line 495 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(35): error:  #256: invalid redeclaration of type name "vsc32" (declared at line 499 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(39): error:  #256: invalid redeclaration of type name "u32" (declared at line 503 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(43): error:  #256: invalid redeclaration of type name "uc32" (declared at line 507 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(47): error:  #256: invalid redeclaration of type name "vu32" (declared at line 511 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(51): error:  #256: invalid redeclaration of type name "vuc32" (declared at line 515 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #101: "RESET" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #101: "SET" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #256: invalid redeclaration of type name "FlagStatus" (declared at line 519 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #256: invalid redeclaration of type name "ITStatus" (declared at line 519 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #101: "DISABLE" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #101: "ENABLE" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #256: invalid redeclaration of type name "FunctionalState" (declared at line 521 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #101: "ERROR" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #101: "SUCCESS" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #256: invalid redeclaration of type name "ErrorStatus" (declared at line 524 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_conf.h(147): warning:  #47-D: incompatible redefinition of macro "HSE_Value" (declared at line 528 of ".\CM3\stm32f10x.h")
compiling stm32f10x_gpio.c...
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(23): error:  #256: invalid redeclaration of type name "s32" (declared at line 487 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(27): error:  #256: invalid redeclaration of type name "sc32" (declared at line 491 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(31): error:  #256: invalid redeclaration of type name "vs32" (declared at line 495 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(35): error:  #256: invalid redeclaration of type name "vsc32" (declared at line 499 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(39): error:  #256: invalid redeclaration of type name "u32" (declared at line 503 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(43): error:  #256: invalid redeclaration of type name "uc32" (declared at line 507 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(47): error:  #256: invalid redeclaration of type name "vu32" (declared at line 511 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(51): error:  #256: invalid redeclaration of type name "vuc32" (declared at line 515 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #101: "RESET" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #101: "SET" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #256: invalid redeclaration of type name "FlagStatus" (declared at line 519 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #256: invalid redeclaration of type name "ITStatus" (declared at line 519 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #101: "DISABLE" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #101: "ENABLE" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #256: invalid redeclaration of type name "FunctionalState" (declared at line 521 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #101: "ERROR" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #101: "SUCCESS" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #256: invalid redeclaration of type name "ErrorStatus" (declared at line 524 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_conf.h(147): warning:  #47-D: incompatible redefinition of macro "HSE_Value" (declared at line 528 of ".\CM3\stm32f10x.h")
compiling system_stm32f10x.c...
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(23): error:  #256: invalid redeclaration of type name "s32" (declared at line 487 of "CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(27): error:  #256: invalid redeclaration of type name "sc32" (declared at line 491 of "CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(31): error:  #256: invalid redeclaration of type name "vs32" (declared at line 495 of "CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(35): error:  #256: invalid redeclaration of type name "vsc32" (declared at line 499 of "CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(39): error:  #256: invalid redeclaration of type name "u32" (declared at line 503 of "CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(43): error:  #256: invalid redeclaration of type name "uc32" (declared at line 507 of "CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(47): error:  #256: invalid redeclaration of type name "vu32" (declared at line 511 of "CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(51): error:  #256: invalid redeclaration of type name "vuc32" (declared at line 515 of "CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #101: "RESET" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #101: "SET" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #256: invalid redeclaration of type name "FlagStatus" (declared at line 519 of "CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #256: invalid redeclaration of type name "ITStatus" (declared at line 519 of "CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #101: "DISABLE" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #101: "ENABLE" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #256: invalid redeclaration of type name "FunctionalState" (declared at line 521 of "CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #101: "ERROR" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #101: "SUCCESS" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #256: invalid redeclaration of type name "ErrorStatus" (declared at line 524 of "CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_conf.h(147): warning:  #47-D: incompatible redefinition of macro "HSE_Value" (declared at line 528 of "CM3\stm32f10x.h")

解決辦法:

在官方給的函式庫標頭檔案路徑(C:\Users\admin\Desktop\ARM3\FWlib\inc   )下 加入stm32f10x_conf.h標頭檔案  下載連結(http://download.csdn.net/detail/xiaoleiacm/7134683) 

重新編譯即可。

相關推薦

keil 4.22 MDK 工程出現定義錯誤

在更新官方的STM32 官方庫3.5版本的函式庫後,建立工程時會出現諸多重定義錯誤,例如: D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(23): error:  #256: invalid redeclaration of

使用Dev C++編譯C++工程出現undefined reference 錯誤

我的工程包含三個檔案,Vector模板類的宣告檔案Vector.h和定義檔案Vector.cpp以及主函式main.cpp,具體程式碼如下: // Vector.h #ifndef VECTOR_H #define VECTOR_H #include <iostream>

sql創表格出現亂碼

har bubuko nbsp val 查看表 utf div 排序規則 表格 1.新建數據庫時,第一次只填寫了數據庫名稱保存數據庫,如下圖: 2.創建一個Student表格,代碼如下,其中有數據有中文,創建完後查看表格數據,發現中文為亂碼 create table

使用PyCharm建立工程出現Anaconda installation is not found

如圖閃電符號位置顯示 1、出現這種情況,首先你要安裝Anaconda工具,點這裡。 2、如果安裝後還出現這種情況,可以試試這個辦法: 以管理員身份開啟命令提示符,輸入以下命令 mklink /D %HOMEPATH%\anaconda D:\Anaconda3 注意

Jupyter notebook 轉pdf出現的一個錯誤(只出現4頁)及原因分析

文章目錄 問題描述 原因分析 解決方案 問題描述 最近迷上了利用Jupyter notebook 為工具學習有關Python語言方面的知識。遇到該錯誤純粹是個偶然,這應該算是Jupyter notebook的一個bug。 問題的

解決eclipse載入已有maven工程出現的fail to read artifact descriptor....問題

從一臺Fedora的電腦中拷過來一個project,在win10的Eclipse下選擇Import->Existing Maven Projects,載入時卻出現以下錯誤:     org.apache.maven.plugins:maven-resources

編譯qt工程出現qt外掛程序退出錯誤的解決辦法

真名:朱金燦 主要經歷:本科畢業於CUG(武漢)的GIS專業,畢業後參加工作,現在在北京從事軟體開發和團隊管理工作。曾獲有色金屬工業科技進步獎二等獎(獲獎證書連結)。 我的聯絡方式: EMAIL:clever101#163.com 研究方向: 數字影象處理、計算機圖形學。 本部落格內

kei5編譯微控制器工程出現:*** FATAL ERROR L250: CODE SIZE LIMIT IN RESTRICTED VERSION EXCEEDED

出現這個的原因是因為MDK51沒有註冊,還需用註冊機對keil5重新註冊 *** FATAL ERROR L250: CODE SIZE LIMIT IN RESTRICTED VERSION EXCEEDED 以管理員身份開啟keil,註冊機選C51,進行註冊,顯示

Eclipse 出現 Package already exists. Note: Views might filter empty parent 的解決方案

有人喜歡在程式設計中把所有的包都建好以後再開始程式設計,就難免會在建包的時候出現: Package already exists. Note: Views might filter empty parent. 這樣的錯誤提示。錯誤是因為該包你已經建了,因為它是一個

Android Studio匯入工程出現的幾種錯誤

找到一個可用工程,用記事本開啟app/build.gradle,找到 compileSdkVersion 23 buildToolsVersion “23.0.0” 將其複製到出錯工程的對應位置即可 2、Error:Gradle 2.4 requir

利用vs2017編寫qt和opencv工程出現“無法開啟原始檔"QCamera”的解決辦法

我們用vs編寫qt工程時,如果用到opencv時,就需要藉助qt自帶的一些視訊讀取的類來呼叫攝像頭裝置,進行攝像頭控制及影象預覽和捕獲,Qt5.0版本新增了QMultimedia模組提供了更為方便的程式設計支援,該模組主要涵蓋視訊、音訊、收音機以及攝像頭等功能支

解決Source Insight拷貝工程出現的“Warning:XXXXXX does not exist and cannot be opened”問題

用Source Insight開啟經常會提示出Warning:XXXXXX does not exist and cannot be opened的問題,後來才發現是工程路徑的問題:開啟工程目錄下的Source Insight,在提示各種錯誤之後按如下操作:1.選單欄Proj

spring 4.1.3 單元測試出現的NoSuchMethodError

今天寫一個WEB專案,使用到了spring mvc ,在maven倉庫中進行了spring相關架包的新增,看到了最新的spring 4.1.3,所以就想試試,可是在寫到單元測試時,總是出現一個下面這個錯誤,在整了一整天后還沒有解決,最後感覺到是不是架包的問題,就將sprin

關於unity開啟非自己原創工程出現名稱空間不存在等錯誤問題

一、問題描述: 今天利用unity的assets server開啟別人的工程時,自己的unity中總會報錯(無論是在vs中還是monodevelop中(,如system.xml.linq名稱空間不存在

Eclipse建立Maven工程出現的Java Build path 問題

問題描述   使用eclipse建立Maven工程時,出現如下錯誤: Description Resource Path Location Type Build path

編譯工程出現異常“[Error] File not found: 'DIALOG.RES'”怎麼解決

高階應用篇:Delphi是個很有效率的開發工具,但是它有一個缺點就是生成的EXE檔案太大.一個程式就算只有一個空視窗體積也有286KB.如果直接用API來寫的話程式體積是小了,但是又太繁瑣,無法立即看到介面效果,根本談不上是視覺化開發.其實並非"魚與熊掌不可兼得",利用資原始檔我們就可以輕鬆達到這個目的.在開

執行PL/SQL塊出現 ORA-06550 錯誤(批量表)

SQL> select * from v$version;   BANNER ---------------------------------------------------------------- Oracle Database 10g Enterprise

ionic創工程中遇到異常、錯誤及解決方法

右鍵 ive hub reac 個推 註意 code down 添加 1. 創建工程——download failed ionic start myApp tabs 遇到如下錯誤 Downloading--Failed! Error:Timeout of 25000m

(三)Django繼承AbstractUser新建User Model出現fields.E304錯誤

install model groups ups com div col access span 錯誤詳情: auth.User.groups: (fields.E304) Reverse accessor for ‘User.groups’ clashes with re

訪問網出現403 Forbidden錯誤的原因:

csu 用戶 網址 class 目錄 火墻 body best b- 1.你的IP被列入黑名單。2.你在一定時間內過多地訪問此網站(一般是用采集程序),被防火墻拒絕訪問了。3.網站域名解析到了空間,但空間未綁定此域名。4.你的網頁腳本文件在當前目錄下沒有執行權限。5.在不允