[英]Linux Kernel error: missing binary operator before token “(”
Some simple preprocessor code in Linux Kernel module gives the following error: Linux内核模块中的一些简单的预处理器代码给出以下错误:
missing binary operator before token "("
令牌“(”前缺少二进制运算符
The code: 编码:
#if defined(AAA) || defined(BBB)
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,13,0)
#define SOME 111
#else
#define SOME 222
#endif
#define OTHER 999
#else
#define SOME 1
#define OTHER 9
#endif /* AAA || BBB */
that error means KERNEL_VERSION is not defined 该错误意味着未定义KERNEL_VERSION
you missed to #include <linux/version.h>
您错过了
#include <linux/version.h>
Edit 编辑
About kernel version see also : Is there a macro definition to check the Linux kernel version? 关于内核版本,另请参见: 是否存在宏定义来检查Linux内核版本?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.