使用环境
<!-- 必须 告知插件运行的环境,帮助开发者定位问题 -->
- 操作系统版本:
- 操作系统平台(x86/x64):win10
- VsCode 版本:
- EIDE 插件版本:3.11.1
- C/C++ 插件版本:
- 何种编译器(keil_c51/sdcc/armcc5/armgcc/...):ac6
- 编译器版本(非编译问题可忽略):6.19
描述问题
<!-- 使用简明清晰的语言描述您的问题 -->
添加cmsis-dsp库后编译失败,出现重复定义问题
cmsis-dsp版本1.14.4
屏幕截图
<!--使用一些截图能够更好地展现问题 -->
[ INFO ] start building at 2023-03-19 18:06:59
[ TOOL ] ARMCLANG 6
[ INFO ] file statistics (rebuild mode)
+---------+-----------+-----------+---------------+--------+
| C Files | Cpp Files | Asm Files | Lib/Obj Files | Totals |
+---------+-----------+-----------+---------------+--------+
| 54 | 0 | 1 | 0 | 55 |
+---------+-----------+-----------+---------------+--------+
[ INFO ] start compilation (jobs: 4) ...
[ 1%] CC 'Firmware/CMSIS/DSP/Source/BayesFunctions/BayesFunctions.c'
[ 3%] CC 'Firmware/CMSIS/DSP/Source/BasicMathFunctions/BasicMathFunctions.c'
[ 5%] CC 'Firmware/CMSIS/DSP/Source/ControllerFunctions/ControllerFunctions.c'
[ 7%] CC 'Firmware/CMSIS/DSP/Source/ComplexMathFunctions/ComplexMathFunctions.c'
[ 9%] CC 'Firmware/CMSIS/DSP/Source/CommonTables/CommonTables.c'
[ 10%] CC 'Firmware/CMSIS/DSP/Source/MatrixFunctions/MatrixFunctions.c'
[ 12%] CC 'Firmware/CMSIS/DSP/Source/StatisticsFunctions/StatisticsFunctions.c'
[ 14%] CC 'Firmware/CMSIS/DSP/Source/FastMathFunctions/FastMathFunctions.c'
[ 16%] CC 'Firmware/CMSIS/DSP/Source/SupportFunctions/SupportFunctions.c'
[ 18%] AS 'Firmware/CMSIS/GD/GD32F4xx/Source/ARM/startup_gd32f450_470.s'
Warning: A1950W: The legacy armasm assembler is deprecated. Consider using the armclang integrated assembler instead.
0 Errors, 1 Warning
[ 20%] CC 'Firmware/CMSIS/GD/GD32F4xx/Source/system_gd32f4xx.c'
[ 21%] CC 'Firmware/CMSIS/DSP/Source/TransformFunctions/TransformFunctions.c'
[ 23%] CC 'Firmware/CMSIS/DSP/Source/FilteringFunctions/FilteringFunctions.c'
[ 25%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_adc.c'
[ 27%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_crc.c'
[ 29%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_can.c'
[ 30%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_ctc.c'
[ 32%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_dac.c'
[ 34%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_dbg.c'
[ 36%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_dci.c'
[ 38%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_dma.c'
[ 40%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_exti.c'
[ 41%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_exmc.c'
[ 43%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_enet.c'
[ 45%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_fwdgt.c'
[ 47%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_gpio.c'
[ 49%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_i2c.c'
[ 50%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_fmc.c'
[ 52%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_iref.c'
[ 54%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_ipa.c'
[ 56%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_misc.c'
[ 58%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_pmu.c'
[ 60%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_rtc.c'
[ 61%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_rcu.c'
[ 63%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_sdio.c'
[ 65%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_spi.c'
[ 67%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_syscfg.c'
[ 69%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_tli.c'
[ 70%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_timer.c'
[ 72%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_trng.c'
[ 74%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_wwdgt.c'
[ 76%] CC 'Hardware/Source/bsp_key.c'
[ 78%] CC 'Firmware/GD32F4xx_standard_peripheral/Source/gd32f4xx_usart.c'
[ 80%] CC 'Hardware/Source/adc.c'
[ 81%] CC 'Hardware/Source/bsp_lcd.c'
[ 83%] CC 'Hardware/Source/bsp_norflash_spi.c'
[ 85%] CC 'Hardware/Source/bsp_usart.c'
[ 87%] CC 'Hardware/Source/bsp_sdram_exmc.c'
[ 89%] CC 'Hardware/Source/dac.c'
[ 90%] CC 'Hardware/Source/dma.c'
[ 92%] CC 'Hardware/Source/tim.c'
[ 94%] CC 'Hardware/Source/gpio.c'
[ 96%] CC 'User/gd32f4xx_it.c'
[ 98%] CC 'User/main.c'
In file included from ./User/main.c:43:
In file included from Firmware/CMSIS/DSP/Include\arm_math.h:188:
In file included from Firmware/CMSIS/DSP/Include/arm_math_types.h:82:
In file included from .cmsis/include\cmsis_compiler.h:47:
.cmsis/include/cmsis_armclang.h:260:31: error: redefinition of '__ROR'
__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2)
^
Firmware/CMSIS\core_cmInstr.h:414:61: note: previous definition is here
attribute( ( always_inline ) ) __STATIC_INLINE uint32_t ROR(uint32_t op1, uint32_t op2)
^
In file included from ./User/main.c:43:
In file included from Firmware/CMSIS/DSP/Include\arm_math.h:188:
In file included from Firmware/CMSIS/DSP/Include/arm_math_types.h:82:
In file included from .cmsis/include\cmsis_compiler.h:47:
.cmsis/include/cmsis_armclang.h:295:30: error: redefinition of 'CLZ'
__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value)
^
Firmware/CMSIS\core_cmInstr.h:592:60: note: previous definition is here
attribute( ( always_inline ) ) __STATIC_INLINE uint8_t CLZ(uint32_t value)
^
In file included from ./User/main.c:43:
In file included from Firmware/CMSIS/DSP/Include\arm_math.h:188:
In file included from Firmware/CMSIS/DSP/Include/arm_math_types.h:82:
In file included from .cmsis/include\cmsis_compiler.h:47:
.cmsis/include/cmsis_armclang.h:737:27: error: redefinition of 'enable_irq'
__STATIC_FORCEINLINE void __enable_irq(void)
^
Firmware/CMSIS\core_cmFunc.h:315:57: note: previous definition is here
attribute( ( always_inline ) ) __STATIC_INLINE void enable_irq(void)
^
In file included from ./User/main.c:43:
In file included from Firmware/CMSIS/DSP/Include\arm_math.h:188:
In file included from Firmware/CMSIS/DSP/Include/arm_math_types.h:82:
In file included from .cmsis/include\cmsis_compiler.h:47:
.cmsis/include/cmsis_armclang.h:750:27: error: redefinition of 'disable_irq'
__STATIC_FORCEINLINE void __disable_irq(void)
^
Firmware/CMSIS\core_cmFunc.h:326:57: note: previous definition is here
attribute( ( always_inline ) ) __STATIC_INLINE void disable_irq(void)
^
In file included from ./User/main.c:43:
In file included from Firmware/CMSIS/DSP/Include\arm_math.h:188:
In file included from Firmware/CMSIS/DSP/Include/arm_math_types.h:82:
In file included from .cmsis/include\cmsis_compiler.h:47:
.cmsis/include/cmsis_armclang.h:762:31: error: redefinition of 'get_CONTROL'
__STATIC_FORCEINLINE uint32_t __get_CONTROL(void)
^
Firmware/CMSIS\core_cmFunc.h:338:61: note: previous definition is here
attribute( ( always_inline ) ) __STATIC_INLINE uint32_t get_CONTROL(void)
^
In file included from ./User/main.c:43:
In file included from Firmware/CMSIS/DSP/Include\arm_math.h:188:
In file included from Firmware/CMSIS/DSP/Include/arm_math_types.h:82:
In file included from .cmsis/include\cmsis_compiler.h:47:
.cmsis/include/cmsis_armclang.h:792:27: error: redefinition of 'set_CONTROL'
__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control)
^
Firmware/CMSIS\core_cmFunc.h:353:57: note: previous definition is here
attribute( ( always_inline ) ) __STATIC_INLINE void set_CONTROL(uint32_t control)
^
In file included from ./User/main.c:43:
In file included from Firmware/CMSIS/DSP/Include\arm_math.h:188:
In file included from Firmware/CMSIS/DSP/Include/arm_math_types.h:82:
In file included from .cmsis/include\cmsis_compiler.h:47:
.cmsis/include/cmsis_armclang.h:818:31: error: redefinition of 'get_IPSR'
__STATIC_FORCEINLINE uint32_t __get_IPSR(void)
^
Firmware/CMSIS\core_cmFunc.h:365:61: note: previous definition is here
attribute( ( always_inline ) ) __STATIC_INLINE uint32_t get_IPSR(void)
^
In file included from ./User/main.c:43:
In file included from Firmware/CMSIS/DSP/Include\arm_math.h:188:
In file included from Firmware/CMSIS/DSP/Include/arm_math_types.h:82:
In file included from .cmsis/include\cmsis_compiler.h:47:
.cmsis/include/cmsis_armclang.h:832:31: error: redefinition of 'get_APSR'
__STATIC_FORCEINLINE uint32_t __get_APSR(void)
^
Firmware/CMSIS\core_cmFunc.h:380:61: note: previous definition is here
attribute( ( always_inline ) ) __STATIC_INLINE uint32_t get_APSR(void)
^
In file included from ./User/main.c:43:
In file included from Firmware/CMSIS/DSP/Include\arm_math.h:188:
In file included from Firmware/CMSIS/DSP/Include/arm_math_types.h:82:
In file included from .cmsis/include\cmsis_compiler.h:47:
.cmsis/include/cmsis_armclang.h:846:31: error: redefinition of 'get_xPSR'
__STATIC_FORCEINLINE uint32_t __get_xPSR(void)
^
Firmware/CMSIS\core_cmFunc.h:395:61: note: previous definition is here
attribute( ( always_inline ) ) __STATIC_INLINE uint32_t get_xPSR(void)
^
In file included from ./User/main.c:43:
In file included from Firmware/CMSIS/DSP/Include\arm_math.h:188:
In file included from Firmware/CMSIS/DSP/Include/arm_math_types.h:82:
In file included from .cmsis/include\cmsis_compiler.h:47:
.cmsis/include/cmsis_armclang.h:860:31: error: redefinition of 'get_PSP'
__STATIC_FORCEINLINE uint32_t __get_PSP(void)
^
Firmware/CMSIS\core_cmFunc.h:410:61: note: previous definition is here
attribute( ( always_inline ) ) __STATIC_INLINE uint32_t get_PSP(void)
^
In file included from ./User/main.c:43:
In file included from Firmware/CMSIS/DSP/Include\arm_math.h:188:
In file included from Firmware/CMSIS/DSP/Include/arm_math_types.h:82:
In file included from .cmsis/include\cmsis_compiler.h:47:
.cmsis/include/cmsis_armclang.h:890:27: error: redefinition of 'set_PSP'
__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack)
^
Firmware/CMSIS\core_cmFunc.h:425:57: note: previous definition is here
attribute( ( always_inline ) ) __STATIC_INLINE void set_PSP(uint32_t topOfProcStack)
^
In file included from ./User/main.c:43:
In file included from Firmware/CMSIS/DSP/Include\arm_math.h:188:
In file included from Firmware/CMSIS/DSP/Include/arm_math_types.h:82:
In file included from .cmsis/include\cmsis_compiler.h:47:
.cmsis/include/cmsis_armclang.h:914:31: error: redefinition of 'get_MSP'
__STATIC_FORCEINLINE uint32_t __get_MSP(void)
^
Firmware/CMSIS\core_cmFunc.h:437:61: note: previous definition is here
attribute( ( always_inline ) ) __STATIC_INLINE uint32_t get_MSP(void)
^
In file included from ./User/main.c:43:
In file included from Firmware/CMSIS/DSP/Include\arm_math.h:188:
In file included from Firmware/CMSIS/DSP/Include/arm_math_types.h:82:
In file included from .cmsis/include\cmsis_compiler.h:47:
.cmsis/include/cmsis_armclang.h:944:27: error: redefinition of 'set_MSP'
__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack)
^
Firmware/CMSIS\core_cmFunc.h:452:57: note: previous definition is here
attribute( ( always_inline ) ) __STATIC_INLINE void set_MSP(uint32_t topOfMainStack)
^
In file included from ./User/main.c:43:
In file included from Firmware/CMSIS/DSP/Include\arm_math.h:188:
In file included from Firmware/CMSIS/DSP/Include/arm_math_types.h:82:
In file included from .cmsis/include\cmsis_compiler.h:47:
.cmsis/include/cmsis_armclang.h:995:31: error: redefinition of 'get_PRIMASK'
__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void)
^
Firmware/CMSIS\core_cmFunc.h:464:61: note: previous definition is here
attribute( ( always_inline ) ) __STATIC_INLINE uint32_t get_PRIMASK(void)
^
In file included from ./User/main.c:43:
In file included from Firmware/CMSIS/DSP/Include\arm_math.h:188:
In file included from Firmware/CMSIS/DSP/Include/arm_math_types.h:82:
In file included from .cmsis/include\cmsis_compiler.h:47:
.cmsis/include/cmsis_armclang.h:1025:27: error: redefinition of 'set_PRIMASK'
__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask)
^
Firmware/CMSIS\core_cmFunc.h:479:57: note: previous definition is here
attribute( ( always_inline ) ) __STATIC_INLINE void set_PRIMASK(uint32_t priMask)
^
In file included from ./User/main.c:43:
In file included from Firmware/CMSIS/DSP/Include\arm_math.h:188:
In file included from Firmware/CMSIS/DSP/Include/arm_math_types.h:82:
In file included from .cmsis/include\cmsis_compiler.h:47:
.cmsis/include/cmsis_armclang.h:1053:27: error: redefinition of 'enable_fault_irq'
__STATIC_FORCEINLINE void __enable_fault_irq(void)
^
Firmware/CMSIS\core_cmFunc.h:492:57: note: previous definition is here
attribute( ( always_inline ) ) __STATIC_INLINE void enable_fault_irq(void)
^
In file included from ./User/main.c:43:
In file included from Firmware/CMSIS/DSP/Include\arm_math.h:188:
In file included from Firmware/CMSIS/DSP/Include/arm_math_types.h:82:
In file included from .cmsis/include\cmsis_compiler.h:47:
.cmsis/include/cmsis_armclang.h:1064:27: error: redefinition of 'disable_fault_irq'
__STATIC_FORCEINLINE void __disable_fault_irq(void)
^
Firmware/CMSIS\core_cmFunc.h:503:57: note: previous definition is here
attribute( ( always_inline ) ) __STATIC_INLINE void disable_fault_irq(void)
^
In file included from ./User/main.c:43:
In file included from Firmware/CMSIS/DSP/Include\arm_math.h:188:
In file included from Firmware/CMSIS/DSP/Include/arm_math_types.h:82:
In file included from .cmsis/include\cmsis_compiler.h:47:
.cmsis/include/cmsis_armclang.h:1075:31: error: redefinition of 'get_BASEPRI'
__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void)
^
Firmware/CMSIS\core_cmFunc.h:515:61: note: previous definition is here
attribute( ( always_inline ) ) __STATIC_INLINE uint32_t get_BASEPRI(void)
^
In file included from ./User/main.c:43:
In file included from Firmware/CMSIS/DSP/Include\arm_math.h:188:
In file included from Firmware/CMSIS/DSP/Include/arm_math_types.h:82:
In file included from .cmsis/include\cmsis_compiler.h:47:
.cmsis/include/cmsis_armclang.h:1105:27: error: redefinition of 'set_BASEPRI'
__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri)
^
Firmware/CMSIS\core_cmFunc.h:530:57: note: previous definition is here
attribute( ( always_inline ) ) __STATIC_INLINE void __set_BASEPRI(uint32_t value)
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
[100%] CC 'User/systick.c'
期望现象
<!--您期望应该产生的,但实际上却没有发生的结果-->