主题 : 求大神指点 编译linux源代码 编译fs/yaffs2/yaffs_vfs.c时出现错误 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 99857
精华: 0
发帖: 5
金钱: 35 两
威望: 7 点
综合积分: 10 分
注册时间: 2014-01-13
最后登录: 2014-03-25
楼主  发表于: 2014-03-24 13:47

 求大神指点 编译linux源代码 编译fs/yaffs2/yaffs_vfs.c时出现错误

编译linux源代码 编译fs/yaffs2/yaffs_vfs.c时出现错误 求大神指点

CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CC      fs/yaffs2/yaffs_ecc.o
  CC      fs/yaffs2/yaffs_vfs.o
fs/yaffs2/yaffs_vfs.c:1786:2: error: unknown field 'readdir' specified in initializer
fs/yaffs2/yaffs_vfs.c:1786:2: warning: initialization from incompatible pointer type
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_proc_debug_write':
fs/yaffs2/yaffs_vfs.c:3300:19: warning: comparison of distinct pointer types lacks a cast
fs/yaffs2/yaffs_vfs.c: In function 'init_yaffs_fs':
fs/yaffs2/yaffs_vfs.c:3394:2: error: implicit declaration of function 'create_proc_entry'
fs/yaffs2/yaffs_vfs.c:3394:16: warning: assignment makes pointer from integer without a cast
fs/yaffs2/yaffs_vfs.c:3398:16: error: dereferencing pointer to incomplete type
fs/yaffs2/yaffs_vfs.c:3399:16: error: dereferencing pointer to incomplete type
fs/yaffs2/yaffs_vfs.c:3400:16: error: dereferencing pointer to incomplete type
make[2]: *** [fs/yaffs2/yaffs_vfs.o] Error 1
make[1]: *** [fs/yaffs2] Error 2
make: *** [fs] Error 2
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2014-03-24 18:09

 回 楼主(yingzhuofeng) 的帖子


fs/yaffs2/yaffs_vfs.c:1786:2: error: unknown field 'readdir' specified in initializer

对应结构体里没有readdir这个栏位?


fs/yaffs2/yaffs_vfs.c:3394:2: error: implicit declaration of function 'create_proc_entry'

没有包含头文件linux/proc_fs.h?
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 99857
精华: 0
发帖: 5
金钱: 35 两
威望: 7 点
综合积分: 10 分
注册时间: 2014-01-13
最后登录: 2014-03-25
2楼  发表于: 2014-03-24 22:42

 回 1楼(kasim) 的帖子

如何解决呢 卡在这好久了
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2014-03-25 11:19

 回 2楼(yingzhuofeng) 的帖子

对于结构体定义不匹配的情况,通常情况下,你需要找一个和你当前使用的内核版本匹配的yaffs2补丁,如果找不到,那就修改你现在用的补丁使之可以与内核匹配;
对于头文件,加入include就可以了。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
^很多问题的背后都是简单的原因......
级别: 荣誉会员
UID: 34780
精华: 0
发帖: 1219
金钱: 6230 两
威望: 1246 点
综合积分: 2438 分
注册时间: 2010-12-21
最后登录: 2017-09-18
4楼  发表于: 2014-03-25 11:19
内核版本是多少? 好像太高的话是会有麻烦的……各种编译错误