AIX ÏÂÓÐ gethostbyname SunOS ÏÂûÓÐgethostbyname º¯Êý ???
¸÷λ:°ïæ¿´Ò»ÏÂÕâ¶Î³ÌÐò#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <rpc/rpc.h>
#include <netdb.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
main (){
struct hostent *hostp;
if ((hostp = gethostbyname("sunv880-2")) != NULL)
{
printf("gethostbyname successful\n");
}
else
{
printf("gethostbyname failure\n");
}
}
ÔÚ sunos 5.8 ÏÂÓà cc -g test3c -o test3exe ±àÒëÊÇÏÔʾ´íÎóÈçÏÂ:
Undefined first referenced
symbol in file
gethostbyname test3.o
Õâ¶Î³ÌÐòÔÚ AIX ÉÏÖ´ÐÐûÓÐÎÊÌâ!
ÊÇʲôÔÒò,Çë¸÷λ¶à¶àÖ¸½Ì!
лл!
ÀäѪ
Ò³:
[1]