Linux一个extern变量的编译错误
我在Suse11下面用GCC4.3.4编译很小的一个程序:
#include<stdio.h>
#include<netdb.h>
extern int h_error;
int main(void){
hostent* p1=gethostbyname("127.0.0.1");
printf("%s\n",hstrerror(h_error));
return 0;
}
#include<stdio.h>
#include<netdb.h>
//extern int h_error;
int main(void){
struct hostent* p1=gethostbyname("127.0.0.1");
printf("%s\n",hstrerror(h_errno));
return 0;
}