我从这段代码中收到以下错误,我是 C 的新手,并且随着我的学习而学习!
cc -g -I /usr/lib/i386-linux-gnu -c anld.c
anld.c: In function ‘main’:
anld.c:379:11: error: dereferencing pointer to incomplete type
主 .C 文件
bridge_t *bridge_p = bridge_new(); //Create / init our bridge
bridge_p->s = server_connect(options.server_p, options.dest_port,
options.ifname_p, options.gateway_p);
桥接 .C 文件
struct bridge
{
int s;
};
bridge_t *bridge_new(void)
{
bridge_t *bridge_p;
bridge_p = OPENSSL_malloc(sizeof *bridge_p);
if (!bridge_p)
{
return NULL;
}
/* Initialise bridge */
memset(bridge_p, '\0', sizeof *bridge_p);
bridge_p->s = -1;
return bridge_p;
}
桥接器.h 文件
typedef struct bridge bridge_t;
有人有什么想法吗??