报错如下:
SourceUsermain.c(41): error: #513: a value of type "struct udp_
PCB*" cannot be assigned to an en
tity of type "struct upd_pcb *"
SourceUsermain.c(42): error: #167: argument of type "struct upd_pcb *" is incompatible with parameter of type "struct udp_pcb *"
SourceUsermain.c(42): error: #167: argument of type "struct upd_pcb *" is incompatible with parameter of type "struct udp_pcb *"
SourceUsermain.c(42): error: #167: argument of type "struct upd_pcb *" is incompatible with parameter of type "struct udp_pcb *"
SourceUsermain.c - 4 Error(s), 0 Warning(s).
我的函数就简单实用UDP
#include "main.h"#include "
STM32_eth.h"#include "stm32f107.h"#include "netconf.h"#include "lwip/pbuf.h"#include "lwip/udp.h"#include "lwip/tcp.h"
.
.
.
.
int main(){struct upd_pcb *udp_pcb_usr;struct ip_addr ipaddr;struct pbuf *p;System_Setup();LwIP_Init();p = pbuf_alloc(PBUF_RAW, sizeof(UDPData), PBUF_RAM);p->payload =(void *)UDPData;IP4_ADDR(&ipaddr, 192, 168, 0, 10);udp_pcb_usr = udp_new();udp_bind(udp_pcb_usr, IP_ADDR_ANY, 161);udp_connect(udp_pcb_usr, &ipaddr, 161);udp_send(udp_pcb_usr, p);while(1){System_Periodic_Handle();}}
类型明明在 udp.h中定义了,我看例程也是这样写的,为什么这里会报错呢?明明是同一个类型的。。。。
0