EXPORT_SYMBOL() 错误--warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL'

最近使用EXPORT_SYMBOL() 导出函数到内核符号表时,出现如下面的错误:

        warning: data definition has no type or storage class

        warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL'

        warning: parameter names (without types) in function declaration

经查找资料,原来自己犯了一个非常低级的错误:没有包含module.h头文件,在文件中包含该头文件即可解决该告警:

        #include <linux/module.h>

猜你喜欢

转载自blog.csdn.net/sean_8180/article/details/81987551
今日推荐