error C2011: “Font”:“struct”类型重定义

本文详细阐述了解决在Visual Studio 2008中引入从Visual C++ 6.0生成的OFFICE库文件时遇到的冲突错误的方法。通过在相关头文件中添加命名空间声明,成功解决了包括结构体类型重定义、未定义类型使用等错误。具体步骤包括在`excel9.h`和`excel9.cpp`文件中分别引入命名空间,并在工作文件中使用`using namespace excel9;`来避免此类问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在vs2008里添加了在VC6.0里形成的OFFICE库文件的类 excel.h,excel.cpp,就是我在VC6里做操作OFFICE的表格时候添加的库文件,然后把它们( excel.h,excel.cpp)加载vs2008里(因为vs2008里夹在的类在很多的文件夹里,而不是在一个文件夹)
然后就报很多的错误。下面的错误只是一部分,
错误 1 error C2011: “Font”: “struct”类型重定义 
错误 2 error C2011: “Picture”: “struct”类型重定义
错误 3 error C2027: 使用了未定义类型“Font” 
错误 4 error C3861: “InvokeHelper”: 找不到标识符 
错误 5 error C2027: 使用了未定义类型“Font” 
错误 6 error C3861: “InvokeHelper”: 找不到标识符 
错误 7 error C2027: 使用了未定义类 
错误 14 error C3861: “InvokeHelper”: 找不到标识符 
错误 15 error C2027: 使用了未定义类型“Font” 
错误 16 error C3861: “InvokeHelper”: 找不到标识符 
错误 17 error C2027: 使用了未定义类型“Font” 
错误 18 error C3861: “InvokeHelper”: 找不到标识符 
错误 19 error C2027: 使用了未定义类型“Font”

 

摸索了半天,总算解决了,原因如下:在VS2008的comdef.h文件中有这么两句:struct Font : IFontDisp {};和struct Picture : IPictureDisp {};结果导致老是出现你所说的冲突,但是VC6下就没问题,原因是VC6的comdef.h文件中没有上面的这两句定义。

解决方法是为excel9添加namespace :

就是在excel9.h的#ifdef...#define...的后面(第一个class的前面)加上namespace excel9 { 再在最后加上结束符号 }
然后在excel9.cpp文件相应位置加上namespace excel9 {  ......  }
在你的工作文件中#include "excel9.h" 并在下一行加上 using namespace excel9;

OK,完美解决。

Build target 'Target 1' compiling main.c... dht11.h(10): error: #20: identifier "uint8_t" is undefined uint8_t DHT11_Read(float *temp, float *humid); main.c(8): error: #20: identifier "RCC" is undefined RCC->CR |= RCC_CR_HSEON; main.c(8): error: #20: identifier "RCC_CR_HSEON" is undefined RCC->CR |= RCC_CR_HSEON; main.c(9): error: #20: identifier "RCC_CR_HSERDY" is undefined while (!(RCC->CR & RCC_CR_HSERDY)); main.c(12): error: #20: identifier "RCC_CFGR_PLLMULL9" is undefined RCC->CFGR |= RCC_CFGR_PLLMULL9 | RCC_CFGR_PLLSRC; main.c(12): error: #20: identifier "RCC_CFGR_PLLSRC" is undefined RCC->CFGR |= RCC_CFGR_PLLMULL9 | RCC_CFGR_PLLSRC; main.c(15): error: #20: identifier "RCC_CR_PLLON" is undefined RCC->CR |= RCC_CR_PLLON; main.c(16): error: #20: identifier "RCC_CR_PLLRDY" is undefined while (!(RCC->CR & RCC_CR_PLLRDY)); main.c(19): error: #20: identifier "RCC_CFGR_SW_PLL" is undefined RCC->CFGR |= RCC_CFGR_SW_PLL; main.c(20): error: #20: identifier "RCC_CFGR_SWS" is undefined while ((RCC->CFGR & RCC_CFGR_SWS) != RCC_CFGR_SWS_PLL); main.c(20): error: #20: identifier "RCC_CFGR_SWS_PLL" is undefined while ((RCC->CFGR & RCC_CFGR_SWS) != RCC_CFGR_SWS_PLL); main.c(23): error: #20: identifier "RCC_CFGR_PPRE1_DIV2" is undefined RCC->CFGR |= RCC_CFGR_PPRE1_DIV2 | RCC_CFGR_PPRE2_DIV1; main.c(23): error: #20: identifier "RCC_CFGR_PPRE2_DIV1" is undefined RCC->CFGR |= RCC_CFGR_PPRE1_DIV2 | RCC_CFGR_PPRE2_DIV1; main.c(29): error: #20: identifier "RCC" is undefined RCC->APB2ENR |= RCC_APB2ENR_IOPAEN | RCC_APB2ENR_IOPBEN | RCC_APB2ENR_IOPCEN; main.c(29): error: #20: identifier "RCC_APB2ENR_IOPAEN" is undefined RCC->APB2ENR |= RCC_APB2ENR_IOPAEN | RCC_APB2ENR_IOPBEN | RCC_APB2ENR_IOPCEN; main.c(29): error: #20: identifier "RCC_APB2ENR_IOPBEN" is undefined RCC->APB2ENR |= RCC_APB2ENR_IOPAEN | RCC_APB2ENR_IOPBEN | RCC_APB2ENR_IOPCEN; main.c(29): error: #20: identifier "RCC_APB2ENR_IOPCEN" is undefined RCC->APB2ENR |= RCC_APB2ENR_IOPAEN | RCC_APB2ENR_IOPBEN | RCC_APB2ENR_IOPCEN; main.c(32): error: #20: identifier "GPIOA" is undefined GPIOA->CRL &= ~(0x0F << (BUTTON_PIN * 4)); // ???? main.c(36): error: #20: identifier "GPIOC" is undefined GPIOC->CRH &= ~(0xFF << 0); // ???? main.c(40): error: #20: identifier "GPIOB" is undefined GPIOB->CRH &= ~(0x0F << 0); main.c(48): warning: #223-D: function "__NOP" declared implicitly __NOP(); main.c(54): error: #20: identifier "GPIOB" is undefined GPIOB->BSRR = (1 << BUZZER_PIN); // ?? main.c(63): error: #20: identifier "GPIOC" is undefined GPIOC->BSRR = (1 << FAN_PIN1); // ?? main.c(66): error: #20: identifier "GPIOC" is undefined GPIOC->BRR = (1 << FAN_PIN1); // ?? main.c(70): error: #20: identifier "GPIOC" is undefined GPIOC->BRR = (1 << FAN_PIN1) | (1 << FAN_PIN2); // ?? main.c(82): error: #268: declaration may not appear after executable statement in block uint8_t fan_state = 0; main.c(83): error: #268: declaration may not appear after executable statement in block uint8_t fan_direction = 1; // 1=??, 0=?? main.c(97): warning: #223-D: function "sprintf" declared implicitly sprintf(buffer, "Temp: %.1fC", temp); main.c(113): error: #20: identifier "GPIOA" is undefined if ((GPIOA->IDR & (1 << BUTTON_PIN)) == 0) { // ????(???) main.c: 2 warnings, 27 errors compiling dht11.c... dht11.h(10): error: #20: identifier "uint8_t" is undefined uint8_t DHT11_Read(float *temp, float *humid); dht11.c(7): error: #20: identifier "GPIOA" is undefined GPIOA->CRL &= ~(0x0F << (4 * DHT11_PIN)); // ???? dht11.c(15): error: #20: identifier "uint8_t" is undefined uint8_t DHT11_Read(float *temp, float *humid) { dht11.c(16): error: #20: identifier "uint8_t" is undefined uint8_t data[5] = {0}; dht11.c(17): error: #20: identifier "uint8_t" is undefined uint8_t i, j; dht11.c(20): error: #20: identifier "GPIOA" is undefined GPIOA->CRL &= ~(0x0F << (4 * DHT11_PIN)); // ???? dht11.c(22): warning: #223-D: function "Delay_ms" declared implicitly Delay_ms(18); dht11.c(41): error: #268: declaration may not appear after executable statement in block uint32_t count = 0; dht11.c(41): error: #20: identifier "uint32_t" is undefined uint32_t count = 0; dht11.c: 1 warning, 8 errors compiling tft_gfx.c... tft_gfx.c(11): error: #20: identifier "RCC" is undefined RCC->APB2ENR |= RCC_APB2ENR_SPI1EN; tft_gfx.c(11): error: #20: identifier "RCC_APB2ENR_SPI1EN" is undefined RCC->APB2ENR |= RCC_APB2ENR_SPI1EN; tft_gfx.c(14): error: #20: identifier "GPIOA" is undefined GPIOA->CRL &= ~(0xFFF << 20); // ??PA5, PA6, PA7?? tft_gfx.c(14): warning: #61-D: integer operation result is out of range GPIOA->CRL &= ~(0xFFF << 20); // ??PA5, PA6, PA7?? tft_gfx.c(18): error: #20: identifier "SPI1" is undefined SPI1->CR1 = SPI_CR1_MSTR | SPI_CR1_SPE | SPI_CR1_SSM | SPI_CR1_SSI; tft_gfx.c(18): error: #20: identifier "SPI_CR1_MSTR" is undefined SPI1->CR1 = SPI_CR1_MSTR | SPI_CR1_SPE | SPI_CR1_SSM | SPI_CR1_SSI; tft_gfx.c(18): error: #20: identifier "SPI_CR1_SPE" is undefined SPI1->CR1 = SPI_CR1_MSTR | SPI_CR1_SPE | SPI_CR1_SSM | SPI_CR1_SSI; tft_gfx.c(18): error: #20: identifier "SPI_CR1_SSM" is undefined SPI1->CR1 = SPI_CR1_MSTR | SPI_CR1_SPE | SPI_CR1_SSM | SPI_CR1_SSI; tft_gfx.c(18): error: #20: identifier "SPI_CR1_SSI" is undefined SPI1->CR1 = SPI_CR1_MSTR | SPI_CR1_SPE | SPI_CR1_SSM | SPI_CR1_SSI; tft_gfx.c(19): error: #20: identifier "SPI_CR1_BR_0" is undefined SPI1->CR1 |= SPI_CR1_BR_0; // 36MHz/4 = 9MHz tft_gfx.c(25): error: #20: identifier "GPIOA" is undefined GPIOA->CRL &= ~(0xFF << (4 * TFT_CS_PIN)); tft_gfx.c(33): warning: #223-D: function "Delay_ms" declared implicitly Delay_ms(100); tft_gfx.c(43): error: #20: identifier "SPI1" is undefined while (!(SPI1->SR & SPI_SR_TXE)); // ???????? tft_gfx.c(43): error: #20: identifier "SPI_SR_TXE" is undefined while (!(SPI1->SR & SPI_SR_TXE)); // ???????? tft_gfx.c(45): error: #20: identifier "SPI_SR_BSY" is undefined while (SPI1->SR & SPI_SR_BSY); // ?????? tft_gfx.c(50): error: #20: identifier "GPIOA" is undefined GPIOA->BRR = (1 << TFT_DC_PIN); // DC=0(??) tft_gfx.c(58): error: #20: identifier "GPIOA" is undefined GPIOA->BSRR = (1 << TFT_DC_PIN); // DC=1(??) tft_gfx.c(85): error: #20: identifier "GPIOA" is undefined GPIOA->BSRR = (1 << TFT_DC_PIN); // DC=1(??) tft_gfx.c(88): error: #254: type name is not allowed for (uint32_t i = 0; i < 320 * 240; i++) { tft_gfx.c(88): error: #65: expected a ";" for (uint32_t i = 0; i < 320 * 240; i++) { tft_gfx.c(88): error: #20: identifier "i" is undefined for (uint32_t i = 0; i < 320 * 240; i++) { tft_gfx.c(103): warning: #223-D: function "TFT_DrawChar" declared implicitly TFT_DrawChar(x, y, *str, font, color); tft_gfx.c(100): warning: #177-D: variable "char_height" was declared but never referenced uint8_t char_height = font->height; tft_gfx.c(110): error: #159: declaration is incompatible with previous "TFT_DrawChar" (declared at line 103) void TFT_DrawChar(uint16_t x, uint16_t y, char c, FontDef *font, uint16_t color) { tft_gfx.c(114): error: #254: type name is not allowed for (uint8_t row = 0; row < font->height; row++) { tft_gfx.c(114): error: #65: expected a ";" for (uint8_t row = 0; row < font->height; row++) { tft_gfx.c(114): error: #20: identifier "row" is undefined for (uint8_t row = 0; row < font->height; row++) { tft_gfx.c(116): error: #254: type name is not allowed for (uint8_t col = 0; col < font->width; col++) { tft_gfx.c(116): error: #65: expected a ";" for (uint8_t col = 0; col < font->width; col++) { tft_gfx.c(116): error: #20: identifier "col" is undefined for (uint8_t col = 0; col < font->width; col++) { tft_gfx.c(118): warning: #223-D: function "TFT_DrawPixel" declared implicitly TFT_DrawPixel(x + col, y + row, color); tft_gfx.c(125): error: #159: declaration is incompatible with previous "TFT_DrawPixel" (declared at line 118) void TFT_DrawPixel(uint16_t x, uint16_t y, uint16_t color) { tft_gfx.c(135): error: #20: identifier "GPIOA" is undefined GPIOA->BSRR = (1 << TFT_DC_PIN); // DC=1(??) tft_gfx.c(138): error: #254: type name is not allowed for (uint32_t i = 0; i < w * h; i++) { tft_gfx.c(138): error: #65: expected a ";" for (uint32_t i = 0; i < w * h; i++) { tft_gfx.c: 5 warnings, 30 errors compiling system_stm32f10x.c... compiling fonts.c... fonts.c(29): error: #20: identifier "NULL" is undefined FontDef Font_16x26 = {16, 26, NULL}; // ?????????? fonts.c: 0 warnings, 1 error compiling misc.c... C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\misc.c(99): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_NVIC_PRIORITY_GROUP(NVIC_PriorityGroup)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\misc.c(117): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NVIC_InitStruct->NVIC_IRQChannelCmd)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\misc.c(159): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_NVIC_VECTTAB(NVIC_VectTab)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\misc.c(178): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_NVIC_LP(LowPowerMode)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\misc.c(202): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_SYSTICK_CLK_SOURCE(SysTick_CLKSource)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\misc.c: 5 warnings, 0 errors compiling stm32f10x_gpio.c... C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_gpio.c(111): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_gpio.c(178): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_gpio.c(286): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_gpio.c(308): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_gpio.c(324): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_gpio.c(346): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_gpio.c(361): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_gpio.c(377): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_gpio.c(397): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_gpio.c(420): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_gpio.c(437): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_gpio.c(466): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_EVENTOUT_PORT_SOURCE(GPIO_PortSource)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_gpio.c(486): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_gpio.c(554): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_REMAP(GPIO_Remap)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_gpio.c(613): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_EXTI_PORT_SOURCE(GPIO_PortSource)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_gpio.c(632): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ETH_MEDIA_INTERFACE(GPIO_ETH_MediaInterface)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_gpio.c: 16 warnings, 0 errors compiling stm32f10x_rcc.c... C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(273): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_HSE(RCC_HSE)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(338): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_CALIBRATION_VALUE(HSICalibrationValue)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(357): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(383): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_PLL_SOURCE(RCC_PLLSource)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(404): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(568): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_SYSCLK_SOURCE(RCC_SYSCLKSource)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(612): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_HCLK(RCC_SYSCLK)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(638): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_PCLK(RCC_HCLK)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(664): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_PCLK(RCC_HCLK)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(703): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_IT(RCC_IT)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(731): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_USBCLK_SOURCE(RCC_USBCLKSource)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(770): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_ADCCLK(RCC_PCLK2)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(832): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_LSE(RCC_LSE)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(865): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(882): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_RTCCLK_SOURCE(RCC_RTCCLKSource)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(896): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(1067): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_AHB_PERIPH(RCC_AHBPeriph)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(1098): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_APB2_PERIPH(RCC_APB2Periph)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(1129): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_APB1_PERIPH(RCC_APB1Periph)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(1188): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_APB2_PERIPH(RCC_APB2Periph)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(1219): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_APB1_PERIPH(RCC_APB1Periph)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(1240): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(1253): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(1285): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_MCO(RCC_MCO)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(1332): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_FLAG(RCC_FLAG)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(1406): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_GET_IT(RCC_IT)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c(1451): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_CLEAR_IT(RCC_IT)); C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\StdPeriph_Driver\src\stm32f10x_rcc.c: 27 warnings, 0 errors assembling startup_stm32f10x_hd.s... compiling system_stm32f10x.c... ".\Objects\01.axf" - 66 Error(s), 56 Warning(s). Target not created. Build Time Elapsed: 00:00:20
最新发布
06-27
Rebuild target 'Target 1' compiling core_cm3.c... assembling startup_stm32f10x_md.s... compiling system_stm32f10x.c... compiling misc.c... compiling stm32f10x_adc.c... compiling stm32f10x_bkp.c... compiling stm32f10x_can.c... compiling stm32f10x_cec.c... compiling stm32f10x_crc.c... compiling stm32f10x_dac.c... compiling stm32f10x_dbgmcu.c... compiling stm32f10x_dma.c... compiling stm32f10x_exti.c... compiling stm32f10x_flash.c... compiling stm32f10x_fsmc.c... compiling stm32f10x_gpio.c... compiling stm32f10x_i2c.c... compiling stm32f10x_it.c... compiling stm32f10x_iwdg.c... compiling stm32f10x_pwr.c... compiling stm32f10x_rcc.c... compiling stm32f10x_rtc.c... compiling stm32f10x_sdio.c... compiling stm32f10x_spi.c... compiling stm32f10x_tim.c... compiling stm32f10x_usart.c... compiling stm32f10x_wwdg.c... compiling main.c... compiling dht11.c... Driver\src\dht11.c(31): error: #20: identifier "GPIO_InitStructure" is undefined GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; Driver\src\dht11.c: 0 warnings, 1 error compiling oled.c... .\Driver\inc\i2c.h(16): warning: #1-D: last line of file ends without a newline #endif Driver\src\oled.c(3): error: #5: cannot open source input file "font.h": No such file or directory #include "font.h" // 瀛楀簱鏁版嵁 Driver\src\oled.c: 1 warning, 1 error compiling vibration.c... compiling voice.c... compiling fan.c... compiling delay.c... compiling i2c.c... .\Driver\inc\i2c.h(16): warning: #1-D: last line of file ends without a newline #endif Driver\src\i2c.c(6): error: #147-D: declaration is incompatible with "void I2C_Init(I2C_TypeDef *, I2C_InitTypeDef *)" (declared at line 535 of ".\Lib\inc\stm32f10x_i2c.h") void I2C_Init(void) { Driver\src\i2c.c(11): error: #20: identifier "I2C_SCL_PIN" is undefined GPIO_InitStructure.GPIO_Pin = I2C_SCL_PIN | I2C_SDA_PIN; Driver\src\i2c.c(11): error: #20: identifier "I2C_SDA_PIN" is undefined GPIO_InitStructure.GPIO_Pin = I2C_SCL_PIN | I2C_SDA_PIN; Driver\src\i2c.c(14): error: #20: identifier "I2C_PORT" is undefined GPIO_Init(I2C_PORT, &GPIO_InitStructure); Driver\src\i2c.c: 1 warning, 4 errors ".\Objects\project1.axf" - 6 Error(s), 2 Warning(s). Target not created. Build Time Elapsed: 00:00:13
06-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值