源代码如下:
#include <sys/types.h>
#include "ourhdr.h"
int
main(void)
{
if(lseek(STDIN_FILENO,0,SEEK_CUR)==-1)
err_sys("cannot seek\n");
else
err_sys("seek ok\n");
exit(0);
}
用gcc编译后的结果是
/tmp/ccFqGnWH.o: In function `main':
/tmp/ccFqGnWH.o(.text+0x27): undefined reference to `err_sys'
/tmp/ccFqGnWH.o(.text+0x39): undefined reference to `err_sys'
collect2: ld returned 1 exit status