使用iw_struct时将指针取消指向不完整的类型错误 [英] Dereferncing pointer to incomplete type error while using iw_struct

查看:179
本文介绍了使用iw_struct时将指针取消指向不完整的类型错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个Linux内核模块,并且试图使用get_wireless_stats函数,但是它一直显示错误消息:
取消引用不完整类型的指针"

这是我的用法,任何人都可以告诉我发生了什么事吗?

Hi, I''m writing a linux kernel module and I''m trying to use the get_wireless_stats function , but it keeps printing an error saying :
"dereferencing pointer to incomplete type"

here''s how I used it, can anyone tell me what''s going on?

struct net_device *dev;
struct iw_statistics *wi_stats;


wi_stats = dev->wireless_handlers->get_wireless_stats(dev);

推荐答案

我认为这与之前发布的任何问题相似.在这里检查

关于将指针取消引用到不完整类型 [
I think this is simialr to any question posted earlier. Check here

about dereferencing pointer to incomplete type[^]


Incompete类型是已声明但未定义的类型(对于struct类型).问题在于,wireless_handlers是在net_device.h中声明的,但未定义,它是在net/iw_handler.h中定义的.我要做的就是包括它,错误消失了!
Incompete type is a type that is declared but not defined (in case of struct types). the problem here was that wireless_handlers is declared in net_device.h but not defined,it''s defined in net/iw_handler.h. All I had to do was include it and the error disappeared!


这篇关于使用iw_struct时将指针取消指向不完整的类型错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆