添加.c文件报错 use of undeclared identifier , use of undeclared identifier等等

添加.c文件报错

比如 use of undeclared identifier

Unknown type name 'NSString

等等

点击.c文件  把 右边栏的 属性的 identity and type 改为Objective-C Source

或者 改成.m文件



Build started: Project: template *** Using Compiler 'V6.19', folder: 'D:\Keil_v5\ARM\ARMCLANG\Bin' Build target 'Target 1' ../User/main.c(2): error: 'lora.h' file not found #include "lora.h" ^~~~~~~~ 1 error generated. compiling main.c... LoRa.c(8): error: use of undeclared identifier 'RCU_AF' rcu_periph_clock_enable(RCU_AF); ^ LoRa.c(9): error: call to undeclared function 'gpio_init'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] gpio_init(LORA_UART_GPIO, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, LORA_UART_GPIO_PIN_TX); ^ LoRa.c(9): error: use of undeclared identifier 'GPIO_MODE_AF_PP' gpio_init(LORA_UART_GPIO, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, LORA_UART_GPIO_PIN_TX); ^ LoRa.c(10): error: use of undeclared identifier 'GPIO_MODE_IN_FLOATING' gpio_init(LORA_UART_GPIO, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, LORA_UART_GPIO_PIN_RX); ^ LoRa.c(23): error: use of undeclared identifier 'GPIO_MODE_IPU' gpio_init(LORA_AUX_GPIO, GPIO_MODE_IPU, GPIO_OSPEED_50MHZ, LORA_AUX_GPIO_PIN); ^ 5 errors generated. compiling LoRa.c... Usart.c(8): error: use of undeclared identifier 'RCU_AF' rcu_periph_clock_enable(RCU_AF); ^ Usart.c(9): error: call to undeclared function 'gpio_init'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] gpio_init(USART_UART_GPIO, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, USART_UART_GPIO_PIN_TX); ^ Usart.c(9): error: use of undeclared identifier 'GPIO_MODE_AF_PP' gpio_init(USART_UART_GPIO, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, USART_UART_GPIO_PIN_TX); ^ Usart.c(10): error: use of undeclared identifier 'GPIO_MODE_IN_FLOATING' gpio_init(USART_UART_GPIO, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, USART_UART_GPIO_PIN_RX); ^ 4 errors generated. compiling Usart.c... ".\Objects\template.axf" - 10 Error(s), 0 Warning(s). Target not created. Build Time Elapsed: 00:00:01
07-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值