链接错误 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版本一样的配置了。

posted @ 2015-10-24 22:23  _海阔天空  阅读(11729)  评论(0编辑  收藏  举报