当前位置: 技术问答>linux和unix
编译的时候报错,大家帮我看看是什么问题
来源: 互联网 发布时间:2015-10-27
本文导语: [root@xxweb chkrootkit]# make sense gcc -DHAVE_LASTLOG_H -o chklastlog chklastlog.c chklastlog.c:37:19: stdio.h: No such file or directory chklastlog.c:39:20: stdlib.h: No such file or directory chklastlog.c:41:22: sys/stat.h: No such file or directory chklast...
[root@xxweb chkrootkit]# make sense
gcc -DHAVE_LASTLOG_H -o chklastlog chklastlog.c
chklastlog.c:37:19: stdio.h: No such file or directory
chklastlog.c:39:20: stdlib.h: No such file or directory
chklastlog.c:41:22: sys/stat.h: No such file or directory
chklastlog.c:42:20: unistd.h: No such file or directory
chklastlog.c:43:20: string.h: No such file or directory
chklastlog.c:44:20: signal.h: No such file or directory
chklastlog.c:45:17: pwd.h: No such file or directory
chklastlog.c:46:23: sys/types.h: No such file or directory
chklastlog.c:47:18: utmp.h: No such file or directory
chklastlog.c:49:21: lastlog.h: No such file or directory
chklastlog.c:51:22: sys/file.h: No such file or directory
chklastlog.c:75: syntax error before "wtmp_file_size"
chklastlog.c:75: warning: data definition has no type or storage class
chklastlog.c:76: syntax error before '*' token
chklastlog.c:76: warning: data definition has no type or storage class
chklastlog.c:81: syntax error before "uid_t"
chklastlog.c:81: warning: no semicolon at end of struct or union
chklastlog.c:83: syntax error before '}' token
chklastlog.c:86: warning: `struct utmp' declared inside parameter list
chklastlog.c:86: warning: its scope is only this definition or declaration, which is probably not what you want
chklastlog.c:86: warning: parameter has incomplete type
chklastlog.c:90: syntax error before '*' token
chklastlog.c:90: warning: data definition has no type or storage class
chklastlog.c:91: syntax error before "uid_t"
chklastlog.c: In function `main':
chklastlog.c:98: storage size of `lastlog_ent' isn't known
chklastlog.c:99: storage size of `utmp_ent' isn't known
chklastlog.c:104: storage size of `wtmp_stat' isn't known
chklastlog.c:106: `uid_t' undeclared (first use in this function)
chklastlog.c:106: (Each undeclared identifier is reported only once
chklastlog.c:106: for each function it appears in.)
chklastlog.c:130: `SIGALRM' undeclared (first use in this function)
chklastlog.c:135: `O_RDONLY' undeclared (first use in this function)
chklastlog.c:136: `stderr' undeclared (first use in this function)
chklastlog.c:155: sizeof applied to an incomplete type
chklastlog.c:156: sizeof applied to an incomplete type
chklastlog.c:162: type of formal parameter 1 is incomplete
chklastlog.c:163: `NULL' undeclared (first use in this function)
chklastlog.c:173: sizeof applied to an incomplete type
chklastlog.c:174: sizeof applied to an incomplete type
chklastlog.c:176: sizeof applied to an incomplete type
chklastlog.c:185: dereferencing pointer to incomplete type
chklastlog.c:186: dereferencing pointer to incomplete type
chklastlog.c: At top level:
chklastlog.c:207: warning: `struct utmp' declared inside parameter list
chklastlog.c:208: parameter `utmp_ent' has incomplete type
chklastlog.c: In function `read_pwd':
chklastlog.c:237: warning: assignment makes pointer from integer without a cast
chklastlog.c:241: `size_t' undeclared (first use in this function)
chklastlog.c:241: syntax error before "sizeof"
chklastlog.c:242: dereferencing pointer to incomplete type
chklastlog.c:243: dereferencing pointer to incomplete type
chklastlog.c:243: `uid_t' undeclared (first use in this function)
chklastlog.c:243: syntax error before ')' token
chklastlog.c:244: dereferencing pointer to incomplete type
chklastlog.c:244: syntax error before "numentries"
chklastlog.c:246: dereferencing pointer to incomplete type
chklastlog.c:246: syntax error before numeric constant
chklastlog.c:250: warning: assignment makes pointer from integer without a cast
chklastlog.c:251: dereferencing pointer to incomplete type
chklastlog.c:251: dereferencing pointer to incomplete type
chklastlog.c:252: dereferencing pointer to incomplete type
chklastlog.c:252: dereferencing pointer to incomplete type
chklastlog.c:252: dereferencing pointer to incomplete type
chklastlog.c:252: dereferencing pointer to incomplete type
chklastlog.c: In function `free_results':
chklastlog.c:261: dereferencing pointer to incomplete type
chklastlog.c:262: dereferencing pointer to incomplete type
chklastlog.c:263: dereferencing pointer to incomplete type
chklastlog.c:265: dereferencing pointer to incomplete type
chklastlog.c: At top level:
chklastlog.c:269: syntax error before '*' token
chklastlog.c: In function `localgetpwnam':
chklastlog.c:271: `size_t' undeclared (first use in this function)
chklastlog.c:271: syntax error before "len"
chklastlog.c:273: dereferencing pointer to incomplete type
chklastlog.c:274: `len' undeclared (first use in this function)
chklastlog.c:275: dereferencing pointer to incomplete type
chklastlog.c:276: dereferencing pointer to incomplete type
chklastlog.c:279: `NULL' undeclared (first use in this function)
chklastlog.c: At top level:
chklastlog.c:282: syntax error before "uid_t"
chklastlog.c: In function `getslot':
chklastlog.c:286: `localpwd' undeclared (first use in this function)
make: *** [chklastlog] Error 1
gcc -DHAVE_LASTLOG_H -o chklastlog chklastlog.c
chklastlog.c:37:19: stdio.h: No such file or directory
chklastlog.c:39:20: stdlib.h: No such file or directory
chklastlog.c:41:22: sys/stat.h: No such file or directory
chklastlog.c:42:20: unistd.h: No such file or directory
chklastlog.c:43:20: string.h: No such file or directory
chklastlog.c:44:20: signal.h: No such file or directory
chklastlog.c:45:17: pwd.h: No such file or directory
chklastlog.c:46:23: sys/types.h: No such file or directory
chklastlog.c:47:18: utmp.h: No such file or directory
chklastlog.c:49:21: lastlog.h: No such file or directory
chklastlog.c:51:22: sys/file.h: No such file or directory
chklastlog.c:75: syntax error before "wtmp_file_size"
chklastlog.c:75: warning: data definition has no type or storage class
chklastlog.c:76: syntax error before '*' token
chklastlog.c:76: warning: data definition has no type or storage class
chklastlog.c:81: syntax error before "uid_t"
chklastlog.c:81: warning: no semicolon at end of struct or union
chklastlog.c:83: syntax error before '}' token
chklastlog.c:86: warning: `struct utmp' declared inside parameter list
chklastlog.c:86: warning: its scope is only this definition or declaration, which is probably not what you want
chklastlog.c:86: warning: parameter has incomplete type
chklastlog.c:90: syntax error before '*' token
chklastlog.c:90: warning: data definition has no type or storage class
chklastlog.c:91: syntax error before "uid_t"
chklastlog.c: In function `main':
chklastlog.c:98: storage size of `lastlog_ent' isn't known
chklastlog.c:99: storage size of `utmp_ent' isn't known
chklastlog.c:104: storage size of `wtmp_stat' isn't known
chklastlog.c:106: `uid_t' undeclared (first use in this function)
chklastlog.c:106: (Each undeclared identifier is reported only once
chklastlog.c:106: for each function it appears in.)
chklastlog.c:130: `SIGALRM' undeclared (first use in this function)
chklastlog.c:135: `O_RDONLY' undeclared (first use in this function)
chklastlog.c:136: `stderr' undeclared (first use in this function)
chklastlog.c:155: sizeof applied to an incomplete type
chklastlog.c:156: sizeof applied to an incomplete type
chklastlog.c:162: type of formal parameter 1 is incomplete
chklastlog.c:163: `NULL' undeclared (first use in this function)
chklastlog.c:173: sizeof applied to an incomplete type
chklastlog.c:174: sizeof applied to an incomplete type
chklastlog.c:176: sizeof applied to an incomplete type
chklastlog.c:185: dereferencing pointer to incomplete type
chklastlog.c:186: dereferencing pointer to incomplete type
chklastlog.c: At top level:
chklastlog.c:207: warning: `struct utmp' declared inside parameter list
chklastlog.c:208: parameter `utmp_ent' has incomplete type
chklastlog.c: In function `read_pwd':
chklastlog.c:237: warning: assignment makes pointer from integer without a cast
chklastlog.c:241: `size_t' undeclared (first use in this function)
chklastlog.c:241: syntax error before "sizeof"
chklastlog.c:242: dereferencing pointer to incomplete type
chklastlog.c:243: dereferencing pointer to incomplete type
chklastlog.c:243: `uid_t' undeclared (first use in this function)
chklastlog.c:243: syntax error before ')' token
chklastlog.c:244: dereferencing pointer to incomplete type
chklastlog.c:244: syntax error before "numentries"
chklastlog.c:246: dereferencing pointer to incomplete type
chklastlog.c:246: syntax error before numeric constant
chklastlog.c:250: warning: assignment makes pointer from integer without a cast
chklastlog.c:251: dereferencing pointer to incomplete type
chklastlog.c:251: dereferencing pointer to incomplete type
chklastlog.c:252: dereferencing pointer to incomplete type
chklastlog.c:252: dereferencing pointer to incomplete type
chklastlog.c:252: dereferencing pointer to incomplete type
chklastlog.c:252: dereferencing pointer to incomplete type
chklastlog.c: In function `free_results':
chklastlog.c:261: dereferencing pointer to incomplete type
chklastlog.c:262: dereferencing pointer to incomplete type
chklastlog.c:263: dereferencing pointer to incomplete type
chklastlog.c:265: dereferencing pointer to incomplete type
chklastlog.c: At top level:
chklastlog.c:269: syntax error before '*' token
chklastlog.c: In function `localgetpwnam':
chklastlog.c:271: `size_t' undeclared (first use in this function)
chklastlog.c:271: syntax error before "len"
chklastlog.c:273: dereferencing pointer to incomplete type
chklastlog.c:274: `len' undeclared (first use in this function)
chklastlog.c:275: dereferencing pointer to incomplete type
chklastlog.c:276: dereferencing pointer to incomplete type
chklastlog.c:279: `NULL' undeclared (first use in this function)
chklastlog.c: At top level:
chklastlog.c:282: syntax error before "uid_t"
chklastlog.c: In function `getslot':
chklastlog.c:286: `localpwd' undeclared (first use in this function)
make: *** [chklastlog] Error 1
|
看看有没有文件/usr/include/stdio.h
如果没有你需要安装glibc-headers包,在linux安装光盘里找
如果没有你需要安装glibc-headers包,在linux安装光盘里找
|
找不到头文件。
其他错误估计也是找不到头文件引起的。
其他错误估计也是找不到头文件引起的。