LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 4471|回复: 8

关于编译的一个问题

[复制链接]
发表于 2007-3-28 21:22:37 | 显示全部楼层 |阅读模式
在编译一个叫lipe的软件时,遇到错误:
common.c:30: error: expected declaration specifiers or '...' before '_llseek'
common.c:30: error: expected declaration specifiers or '...' before 'fd'
common.c:30: error: expected declaration specifiers or '...' before 'hi'
common.c:30: error: expected declaration specifiers or '...' before 'lo'
common.c:30: error: expected declaration specifiers or '...' before 'res'
common.c:30: error: expected declaration specifiers or '...' before 'wh'
common.c:34: warning: return type defaults to 'int'
common.c: In function '_syscall5':
common.c:35: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
common.c:54: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
common.c:73: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
common.c:105: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
common.c:128: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
common.c:134: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
common.c:152: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
common.c:171: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
common.c:192: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
common.c:210: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
common.c:228: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
common.c:30: error: parameter name omitted
common.c:30: error: parameter name omitted
common.c:30: error: parameter name omitted
common.c:30: error: parameter name omitted
common.c:30: error: parameter name omitted
common.c:30: error: parameter name omitted


common.c的第30行是:
extern _syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo, loff_t *, res, uint, wh)


是不是现在不能这样做系统调用了,如何修改呢?
发表于 2007-3-30 14:02:03 | 显示全部楼层
是多了几个逗号。
extern _syscall5(int _llseek, uint fd, ulong hi, ulong lo, loff_t * res, uint wh)
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-3-31 00:36:57 | 显示全部楼层
不是的,_syscall5是要跟十一个参数的,他的写法没有错
回复 支持 反对

使用道具 举报

发表于 2007-3-31 01:36:38 | 显示全部楼层
Post by chenxingchen
在编译一个叫lipe的软件时,遇到错误:
common.c:30: error: expected declaration specifiers or '...' before '_llseek'
common.c:30: error: expected declaration specifiers or '...' before 'fd'
common.c:30: error: expected declaration specifiers or '...' before 'hi'
common.c:30: error: expected declaration specifiers or '...' before 'lo'
common.c:30: error: expected declaration specifiers or '...' before 'res'
common.c:30: error: expected declaration specifiers or '...' before 'wh'
.......
common.c的第30行是:
extern _syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo, loff_t *, res, uint, wh)

编译器找不到 _llseek, fd, hi, lo, res, wh这几种变量类型的定义,找找他们是在那个头文件里定义的。我估计是楼主缺包。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-4-2 13:00:50 | 显示全部楼层
在参考里也是这样写的,我想也是缺包,可是不知道缺什么包
回复 支持 反对

使用道具 举报

发表于 2007-4-2 13:14:47 | 显示全部楼层
这个程序在 make 之前有 configure 的步骤吧,那时提到缺了哪些包吗?另外如果有 INSTALL,README 之类的文档,里面也许会提到依赖关系
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-4-5 17:14:30 | 显示全部楼层
并没有提到。
回复 支持 反对

使用道具 举报

发表于 2007-12-22 20:05:12 | 显示全部楼层
linux/unistd.h cannot be found

add:
-I /usr/include/linux/
回复 支持 反对

使用道具 举报

发表于 2008-7-30 13:45:45 | 显示全部楼层
据我的经验有可能是你在某个头文件中进行函数原型 的声明时,在其后漏掉了分号‘;’         !
回复 支持 反对

使用道具 举报

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

本版积分规则

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