QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1079|回复: 4

编译mga_vid.o模块时出错,高人帮我看看,我是新手。

[复制链接]
发表于 2003-9-13 18:23:27 | 显示全部楼层 |阅读模式
我的系统是RH9 2.4.20-8 显卡是MGA G450,已经安装了MGA的4。3驱动,按照mplayer的DOCS中说的那样,编译mga_vid.o时出现下面的错误:
cc -O2 -D__KERNEL__ -DMODULE -include /usr/src/linux/include/linux/modversions.h -I/usr/src/linux/include -c mga_vid.c
mga_vid.c: /usr/src/linux/include/linux/modversions.h: 没有那个文件或目录
In file included from /usr/include/linux/fs.h:23,
from /usr/include/linux/capability.h:17,
from /usr/include/linux/binfmts.h:5,
from /usr/include/linux/sched.h:9,
from mga_vid.c:39:
/usr/include/linux/string.h:8:2: warning: #warning Using kernel header in userland!
In file included from /usr/include/linux/sched.h:14,
from mga_vid.c:39:
/usr/include/linux/timex.h:173: field `time' has incomplete type
In file included from /usr/include/linux/bitops.h:69,
from /usr/include/asm/system.h:7,
from /usr/include/linux/sched.h:16,
from mga_vid.c:39:
/usr/include/asm/bitops.h:327:2: warning: #warning This includefile is not available on all architectures.
/usr/include/asm/bitops.h:328:2: warning: #warning Using kernel headers in userspace: atomicity not guaranteed
In file included from /usr/include/linux/signal.h:4,
from /usr/include/linux/sched.h:25,
from mga_vid.c:39:
/usr/include/asm/signal.h:107: parse error before "sigset_t"
/usr/include/asm/signal.h:110: parse error before '}' token
In file included from /usr/include/linux/sched.h:81,
from mga_vid.c:39:
/usr/include/linux/timer.h:45: parse error before "spinlock_t"
/usr/include/linux/timer.h:53: parse error before '}' token
/usr/include/linux/timer.h:67: parse error before "tvec_base_t"
/usr/include/linux/timer.h:101: parse error before "tvec_bases"
/usr/include/linux/timer.h: In function `init_timer':
/usr/include/linux/timer.h:105: dereferencing pointer to incomplete type
/usr/include/linux/timer.h:105: dereferencing pointer to incomplete type
/usr/include/linux/timer.h:106: dereferencing pointer to incomplete type
/usr/include/linux/timer.h: In function `timer_pending':
/usr/include/linux/timer.h:121: dereferencing pointer to incomplete type
mga_vid.c:64:25: asm/uaccess.h: 没有那个文件或目录
mga_vid.c: In function `mga_vid_set_config':
mga_vid.c:704: `KERN_ERR' undeclared (first use in this function)
mga_vid.c:704: (Each undeclared identifier is reported only once
mga_vid.c:704: for each function it appears in.)
mga_vid.c:704: parse error before string constant
mga_vid.c:772: parse error before string constant
mga_vid.c: At top level:
mga_vid.c:1172: warning: `struct file' declared inside parameter list
mga_vid.c:1172: warning: its scope is only this definition or declaration, which is probably not what you want
mga_vid.c:1172: warning: `struct inode' declared inside parameter list
mga_vid.c: In function `mga_vid_ioctl':
mga_vid.c:1193: `KERN_ERR' undeclared (first use in this function)
mga_vid.c:1193: parse error before string constant
mga_vid.c:1197: parse error before string constant
mga_vid.c:1202: parse error before string constant
mga_vid.c:1207: parse error before string constant
mga_vid.c:1213: parse error before string constant
mga_vid.c:1230: parse error before string constant
mga_vid.c:1268: parse error before string constant
mga_vid.c:1282: parse error before string constant
mga_vid.c:1297: parse error before string constant
mga_vid.c: In function `mga_vid_find_card':
mga_vid.c:1310: warning: assignment makes pointer from integer without a cast
mga_vid.c:1313: `KERN_INFO' undeclared (first use in this function)
mga_vid.c:1313: parse error before string constant
mga_vid.c:1315: warning: assignment makes pointer from integer without a cast
mga_vid.c:1318: parse error before string constant
mga_vid.c:1320: warning: assignment makes pointer from integer without a cast
mga_vid.c:1323: parse error before string constant
mga_vid.c:1325: warning: assignment makes pointer from integer without a cast
mga_vid.c:1328: parse error before string constant
mga_vid.c:1332: `KERN_ERR' undeclared (first use in this function)
mga_vid.c:1332: parse error before string constant
mga_vid.c:1338: dereferencing pointer to incomplete type
mga_vid.c:1341: dereferencing pointer to incomplete type
mga_vid.c:1341: warning: assignment makes pointer from integer without a cast
mga_vid.c:1342: dereferencing pointer to incomplete type
mga_vid.c:1347: parse error before string constant
mga_vid.c:1350: parse error before string constant
mga_vid.c:1356: parse error before string constant
mga_vid.c:1379: parse error before string constant
mga_vid.c:1383: dereferencing pointer to incomplete type
mga_vid.c:1384: dereferencing pointer to incomplete type
mga_vid.c:1385: dereferencing pointer to incomplete type
mga_vid.c:1387: parse error before string constant
mga_vid.c:1410: parse error before string constant
mga_vid.c:1429: parse error before string constant
mga_vid.c: At top level:
mga_vid.c:1453: warning: `struct file' declared inside parameter list
mga_vid.c:1465: warning: `struct file' declared inside parameter list
mga_vid.c:1495: warning: `struct vm_area_struct' declared inside parameter list
mga_vid.c:1495: warning: `struct file' declared inside parameter list
mga_vid.c: In function `mga_vid_mmap':
mga_vid.c:1505: dereferencing pointer to incomplete type
mga_vid.c:1506: dereferencing pointer to incomplete type
mga_vid.c:1506: dereferencing pointer to incomplete type
mga_vid.c:1506: dereferencing pointer to incomplete type
mga_vid.c:1509: `KERN_ERR' undeclared (first use in this function)
mga_vid.c:1509: parse error before string constant
mga_vid.c: At top level:
mga_vid.c:1516: warning: `struct file' declared inside parameter list
mga_vid.c:1516: warning: `struct inode' declared inside parameter list
mga_vid.c: In function `mga_vid_release':
mga_vid.c:1530: union has no member named `usecount'
mga_vid.c: At top level:
mga_vid.c:1534: warning: `struct file' declared inside parameter list
mga_vid.c:1539: warning: `struct file' declared inside parameter list
mga_vid.c:1539: warning: `struct inode' declared inside parameter list
mga_vid.c: In function `mga_vid_open':
mga_vid.c:1544: dereferencing pointer to incomplete type
mga_vid.c:1554: union has no member named `usecount'
mga_vid.c: At top level:
mga_vid.c:1559: variable `mga_vid_fops' has initializer but incomplete type
mga_vid.c:1561: unknown field `llseek' specified in initializer
mga_vid.c:1561: warning: excess elements in struct initializer
mga_vid.c:1561: warning: (near initialization for `mga_vid_fops')
mga_vid.c:1562: unknown field `read' specified in initializer
mga_vid.c:1562: warning: excess elements in struct initializer
mga_vid.c:1562: warning: (near initialization for `mga_vid_fops')
mga_vid.c:1563: unknown field `write' specified in initializer
mga_vid.c:1563: warning: excess elements in struct initializer
mga_vid.c:1563: warning: (near initialization for `mga_vid_fops')
mga_vid.c:1564: unknown field `ioctl' specified in initializer
mga_vid.c:1564: warning: excess elements in struct initializer
mga_vid.c:1564: warning: (near initialization for `mga_vid_fops')
mga_vid.c:1565: unknown field `mmap' specified in initializer
mga_vid.c:1565: warning: excess elements in struct initializer
mga_vid.c:1565: warning: (near initialization for `mga_vid_fops')
mga_vid.c:1566: unknown field `open' specified in initializer
mga_vid.c:1566: warning: excess elements in struct initializer
mga_vid.c:1566: warning: (near initialization for `mga_vid_fops')
mga_vid.c:1567: unknown field `release' specified in initializer
mga_vid.c:1568: warning: excess elements in struct initializer
mga_vid.c:1568: warning: (near initialization for `mga_vid_fops')
mga_vid.c: In function `mga_vid_initialize':
mga_vid.c:1595: `KERN_INFO' undeclared (first use in this function)
mga_vid.c:1595: parse error before string constant
mga_vid.c:1599: `KERN_ERR' undeclared (first use in this function)
mga_vid.c:1599: parse error before string constant
mga_vid.c:1624: parse error before string constant
mga_vid.c:1630: parse error before string constant
mga_vid.c:1637: `GFP_KERNEL' undeclared (first use in this function)
mga_vid.c:1637: warning: assignment makes pointer from integer without a cast
mga_vid.c: In function `cleanup_module':
mga_vid.c:1662: `KERN_INFO' undeclared (first use in this function)
mga_vid.c:1662: parse error before string constant
/usr/include/asm/io.h: At top level:
mga_vid.c:1559: storage size of `mga_vid_fops' isn't known
make: *** [mga_vid.o] Error 1
发表于 2003-9-14 05:54:58 | 显示全部楼层
error is here:
/usr/src/linux/include/linux/modversions.h: not found

check if u have /usr/src/linux. for rh, if u do not compile kernel before, there is probably no such linux subdir.
回复

使用道具 举报

 楼主| 发表于 2003-9-14 11:38:43 | 显示全部楼层
我检查了一下,果然没有那个目录,但是具体该如何办呢,请你讲详细一点,我是新手,对内核和模块什么的都没经验。谢谢你了。
回复

使用道具 举报

 楼主| 发表于 2003-9-14 13:09:40 | 显示全部楼层
成功了,我的mplayer终于可以用xmga了,我在/usr/src下做了个连接linux 指向/usr/src/linux2.4.20-8,然后再make,结果又出错。然后根据出错的信息找到mga_vid.c1505行处,大概意思是说如果内核版本大于2.5.X和小于此版本的要用不同的参数,但是下面那个函数只有4个参数,而上面的却有5个,我就照2.5.X内核应该使用的那个函数把差的那个参数补上,然后再编译,结果居然通过了。然后照mplayer的DOCS上说的照做,另外我重装了MGA官方的XFree86 4.3的驱动,重启后运行MPlayer,视频驱动选Xmga,打开文件播放一切正常。还有就是运行mgapdesk后,以前几个双头支持的选项都显不出来,而且每次都警告说驱动不兼容,有些特性不能支持,这次居然没报错,双头的所有支持选项也可用了,爽啊。
下次准备弄一下TVout,有问题还要请你指点啊。
谢谢,谢谢,非常感谢!
回复

使用道具 举报

发表于 2003-9-15 08:32:03 | 显示全部楼层
hehe, so u can see that with some patience, some time to spend, u can solve it and u can know more and quicker.
thx for sharing u experience.  
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-12-4 17:54 , Processed in 0.056874 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表