0

我正在为 Nexus 7 Android 内核编写一个 C++ 模块。之前我用 Goldfish 内核成功编译了这个模块。但是现在在将必要的更改移植到 Nexus 7 内核之后,我遇到了编译错误。问题似乎出在标题上。每当我在模块中包含 linux/fs.h 或 linux/debugfs.h 时,都会出现以下错误。

/linux/radix-tree.h:在函数“void* radix_tree_deref_slot(void**)”中:/android_kernel_grouper-android-tegra3-grouper-3.1-jb-fr2/include/linux/radix-tree.h:153:9 : 错误: 'void*' 不是指向对象的指针类型

radix-tree.h 中的对应行与 rcu_dereference() 有关。

是头文件的问题,还是 makefile 的问题,还是由于修补错误?

4

1 回答 1

0

To find out the compilation parameters used in gcc (or g++), you should use "make V=1" against the makefile. but the error:

error: 'void*' is not a pointer-to-object type

looked more like a C++ error, which is inherent in your code (Android kernel does not use C++).

This seemed to be solvable by recasting:

Error: ‘void*’ is not a pointer-to-object type

C++. Error: void is not a pointer-to-object type

etc.

于 2013-07-24T00:09:52.630 回答