鏈接錯誤 multiply defined (by misc_1.o and misc.o).


http://www.stmcu.org/module/forum/thread-286128-1-1.html

*** Using Compiler 'V5.06 (build 20)', folder: 'd:\Keil_v5\ARM\ARMCC\Bin'
Build target 'Target 1'
compiling stm32f10x_it.c...
linking...
.\Objects\stm32demo.axf: Error: L6200E: Symbol __asm___6_misc_c_d0fc1254____REV16 multiply defined (by misc_1.o and misc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol __asm___6_misc_c_d0fc1254____REVSH multiply defined (by misc_1.o and misc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol __asm___6_misc_c_d0fc1254____RRX multiply defined (by misc_1.o and misc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol NVIC_Init multiply defined (by misc_1.o and misc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol NVIC_PriorityGroupConfig multiply defined (by misc_1.o and misc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol NVIC_SetVectorTable multiply defined (by misc_1.o and misc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol NVIC_SystemLPConfig multiply defined (by misc_1.o and misc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol SysTick_CLKSourceConfig multiply defined (by misc_1.o and misc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_APB2PeriphResetCmd multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_BackupResetCmd multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_APB1PeriphResetCmd multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol __asm___16_stm32f10x_gpio_c_f8e8e39a____REV16 multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol __asm___16_stm32f10x_gpio_c_f8e8e39a____REVSH multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol __asm___16_stm32f10x_gpio_c_f8e8e39a____RRX multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol GPIO_AFIODeInit multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol GPIO_DeInit multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol GPIO_ETH_MediaInterfaceConfig multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol GPIO_EXTILineConfig multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol GPIO_EventOutputCmd multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol GPIO_EventOutputConfig multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol GPIO_Init multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol GPIO_PinLockConfig multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol GPIO_PinRemapConfig multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol GPIO_ReadInputData multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol GPIO_ReadInputDataBit multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol GPIO_ReadOutputData multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol GPIO_ReadOutputDataBit multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol GPIO_ResetBits multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol GPIO_SetBits multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol GPIO_StructInit multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol GPIO_Write multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol GPIO_WriteBit multiply defined (by stm32f10x_gpio_1.o and stm32f10x_gpio.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_GetClocksFreq multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol __asm___15_stm32f10x_rcc_c_49e27980____REV16 multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol __asm___15_stm32f10x_rcc_c_49e27980____REVSH multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol __asm___15_stm32f10x_rcc_c_49e27980____RRX multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_ADCCLKConfig multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_AHBPeriphClockCmd multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_APB1PeriphClockCmd multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_APB2PeriphClockCmd multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_AdjustHSICalibrationValue multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_ClearFlag multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_ClearITPendingBit multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_ClockSecuritySystemCmd multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_DeInit multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_GetFlagStatus multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_GetITStatus multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_GetSYSCLKSource multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_HCLKConfig multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_HSEConfig multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_HSICmd multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_ITConfig multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_LSEConfig multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_LSICmd multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_MCOConfig multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_PCLK1Config multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_PCLK2Config multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_PLLCmd multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_PLLConfig multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_RTCCLKCmd multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_RTCCLKConfig multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_SYSCLKConfig multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_USBCLKConfig multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol RCC_WaitForHSEStartUp multiply defined (by stm32f10x_rcc_1.o and stm32f10x_rcc.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol __asm___18_system_stm32f10x_c_5d646a67____REV16 multiply defined (by system_stm32f10x_1.o and system_stm32f10x.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol __asm___18_system_stm32f10x_c_5d646a67____REVSH multiply defined (by system_stm32f10x_1.o and system_stm32f10x.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol __asm___18_system_stm32f10x_c_5d646a67____RRX multiply defined (by system_stm32f10x_1.o and system_stm32f10x.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol SystemCoreClock multiply defined (by system_stm32f10x_1.o and system_stm32f10x.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol AHBPrescTable multiply defined (by system_stm32f10x_1.o and system_stm32f10x.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol SystemCoreClockUpdate multiply defined (by system_stm32f10x_1.o and system_stm32f10x.o).
.\Objects\stm32demo.axf: Error: L6200E: Symbol SystemInit multiply defined (by system_stm32f10x_1.o and system_stm32f10x.o).
Not enough information to list image symbols.
Not enough information to list the image map.
Finished: 2 information, 0 warning and 71 error messages.
".\Objects\stm32demo.axf" - 71 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed: 00:00:05

今天開始學習stm32使用,按照野火的STM32庫開發實戰指南第三章配置開發環境,編譯時候出現上述錯誤,網上查了下是重復定義錯誤,因為我的IDE是最新的5.16,書上用的是4.12,所以配置起來還是有點麻煩,而最新的基本不用怎么配置,Project創建的時候就加入的啟動文件等必須的相關文件,所以書上的那幾個文件StartCode、CMSIS、FWlib、Output這幾個通通不需要,只留個User文件夾放自己寫的代碼就夠了,5.16建立好的Project的目錄如下圖:

紅框里的Device里已經包含了所有需要的文件,不需要像4.12版本一樣的配置了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM