>> Delete No. 45435 article
No. 학교 Sun 서버에서 cc로 컴파일 시킬려면...

등록 2002-03-24 15:18:00 By localhost     조회 2
이름 초보맨    

		이런 에러메시지가 나옵니다. 물론 리눅스에선 잘 컴파일 됩니다.
왜그런걸까요?
]# cc -o get_hostname get_hostname.c
 License Error : Cannot connect to the license server (cs)..
        for product(SPARCompiler C).
        (License server may not have been started)
Cannot connect to license server (-15,12:146) Connection refused
cc: acomp failed for get_hostname.c
 위에처럼 나오는데요. 왜그런지 알수가 없네요. 소스는 아래와
같습니다. gethostbyname()함수만 쓸려면 그러는거 같은데...
 #include stdio.h
#include sys/types.h
#include netinet/in.h
#include netdb.h
 int main(int argc, char **argv)
{
  struct hostent *myhost;
  struct in_addr myinaddr;
  int i;
   if(argc < 2){
    printf("Using : %s host_name(Domain Name)", argv[0]);
    exit(0);
  }
   myhost = gethostbyname(argv[1]);
  if(myhost == 0){
    printf("error at gethostbyname");
    exit(0);
  }  printf("Official host name : 		%s", myhost->h_name);
   i = 0;
  while(myhost->h_aliases[i] != NULL){
    printf("aliases name : 		%s", myhost->h_aliases[i]);
    i++;
  }
   printf("host address type : 		%d", myhost->h_addrtype);
  printf("length of host address : 	%d", myhost->h_length);
   i = 0;
  while(myhost->h_addr_list[i] != NULL){
    myinaddr.s_addr = *((u_long *)(myhost->h_addr_list[i]));
    printf("IP Address : 			%s", inet_ntoa(myinaddr));
    i++;
  }
  exit(0);
}
[관리자] 패스워드를 입력 하십시오. 답장이 존재하면 함께 삭제됩니다.[ 목록 | 이전 ]
패스워드:    

Copyleft 1999-2026 by JSBoard Open Project
Theme Designed by IDOO All right reserved