Korea FreeBSD Users Group News, Internal, Projects, Home
Software, Support, Documentation

Re: 소켓 프로그래밍 컴파일 관련 질문입니다



[ ¥ ] [ ۼ ] [ ֻ ]

[ ] [ ] [ ] [ ]


On Mon, Mar 17, 2003 at 11:44:17PM +0900, Heejong wrote:
>  FreeBSD를 새로 설치하고 예전에 과제로 짰던 프로그램을 돌려보았는데요
> 
>  분명히 학과 기계인 SunOS 에서도 -lsocket -lnsl 옵션을 줘서 컴파일
> 
>  가능하고.. 다른 리눅스 서버에서는 별다른 옵션없이 컴파일 가능한
> 
>  소켓 프로그래밍 소스가 컴파일이 안됩니다. 4.7버전을 시디로 설치했고
> 
>  make world로 4.7-p7으로 만들었습니다. 에러메세지는
> 
> In file included from client.c:8:
> /usr/include/netinet/in.h:233: syntax error before `in_addr_t'
> /usr/include/netinet/in.h:285: syntax error before `u_char'
> In file included from /usr/include/netinet/in.h:467,
>                  from client.c:8:
> /usr/include/netinet6/in6.h:122: syntax error before `u_int8_t'
> /usr/include/netinet6/in6.h:144: syntax error before `u_int8_t'
> /usr/include/netinet6/in6.h:149: syntax error before `u_int32_t'
> /usr/include/netinet6/in6.h:608: syntax error before `struct'
> /usr/include/netinet6/in6.h:610: syntax error before `__P'
> /usr/include/netinet6/in6.h:611: syntax error before `__P'

소켓 관련 헤더들은 서로 심볼 의존이 아주 복잡해서 man에 나오는 순서대로
적어주지 않으면 에러가 납니다. 예를 들면 sys/socket.h 이전에는 반드시
sys/types.h를 포함해줘야 한다든지 등의 관계가 각 함수와 헤더 관련 man
에 있습니다. 몇가지만 지켜주면 사실 별 신경은 안 써도 되는데, 순서를
약간 조절해 보세요.


    Hye-Shik =)

--
Please look and take part in KFUG FAQ: <http://www.kr.freebsd.org/FAQ-kr/>
To Unsubscribe: send mail to majordomo@xxxxxxxxxxxxxx
with "unsubscribe questions" in the BODY of the message



[ ¥ ] [ ۼ ] [ ֻ ]

Copyright © 1998-2005 Korea FreeBSD Users Group.
All rights reserved. webmaster at kr.FreeBSD.org
$Date: 2003/03/31 23:00:55 $
Powered by FreeBSD