>> Edit article
이름
제목
패스워드
linux 가 아닌 대부분의 unix 에 컴파일러는 껴서 주는게 아니라 사야 하는 '상용' 제품입니다. 해당 서버에 license 가 없어서 그런 에러 메시지를 내보내는 겁니다. 해결방안은 gcc 를 설치 하십시요. sunfreeware 에 그밖에 다른 gnu tools 도 있으니 받아서 설치 하시면 됩니다. : 이런 에러메시지가 나옵니다. 물론 리눅스에선 잘 컴파일 됩니다. : 왜그런걸까요? : ]# 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