>> Delete No. 31349 article
No. gcc 컴파일 에러가 났습니다. 한번 봐주세요.

등록 2001-05-25 13:03:00 By localhost     조회 1
이름 이우정    

		<HTML>
<Head>
<Head>
<body>
<Table align="center" border="1">
  <TR>
    <TD>
안녕하세요.
컴파일을 하다가 다음과 같은 에러를 만났습니다.
님께서 한번 살펴보시고 답변 부탁드립니다.
 살펴보시는데 도움이 될지도 모르니 나름대로 에러 내용에 대한 설명을
해보겠습니다.
 아래 내용은 워크래프트 클론을 가져다가 컴파일 하는 가운데 나온 에러입니다.
    </TD>
  </TR>
  <TR>
    <TD>
1. 컴파일중에 나타난 로그
 -c -O2 -pipe -fomit-frame-pointer -fconserve-space -fexpensive-optimizations
-ffast-math  -I/usr/local/src/clone-000402/src/include -I/usr/X11R6/include
-I/usr/local/include -I/usr/local/src/clone-000402/libpng-1.0.5
-I/usr/local/src/clone-000402/zlib-1.1.3  -DUSE_CCL2 '-DVERSION="1.16.1"'
-DUSE_X11 -DUSE_ZLIB -DUSE_BZ2LIB -DWITH_SOUND  -DNEW_VIDEO  -DSLOW_INPUT
slibu.c -o slibu.o
In file included from slibu.c:29:
/usr/include/sys/wait.h:114: parse error before `__stat_loc'
/usr/include/sys/wait.h:115: parse error before `__stat_loc'
In file included from slibu.c:29:
/usr/include/sys/wait.h:162: parse error before `__stat_loc'
/usr/include/sys/wait.h:172: parse error before `__WAIT_STATUS'
slibu.c: In function `lwait':
slibu.c:506: `WNOHANG' undeclared (first use in this function)
slibu.c:506: (Each undeclared identifier is reported only once
slibu.c:506: for each function it appears in.)
slibu.c:507: `WUNTRACED' undeclared (first use in this function)
make[2]: *** [slibu.o] 오류 1
make[2]: 나감 `/usr/local/src/clone-000402/src/siod' 디렉토리
make[1]: *** [all] 오류 2
make[1]: 나감 `/usr/local/src/clone-000402/src' 디렉토리
make: *** [src] 오류 2
     </TD>
  </TR>
  <TR>
    <TD>
위의 에러에서 보이듯이 컴파일을 해나가다가 slibu.c에서 에러를 만났습니다.
 에러내용은 /usr/include/sys/wait.h 파일에서 __stat_loc를 파서 하는 중 에러
를 만나서 컴파일을 중단했다는 내용이구요.
 그래서 wait.h파일을 살펴보았습니다.
쩝... 제가 보기에는 아무리 살펴봐도 문제를 찾지 못하겠습니다.
 그럼 아래에 wait.h파일의 내용을 올리겠습니다.
    </TD>
  </TR>
  <TR>
    <TD>
2. wait.h 파일의 내용.
   보시기 편하시도록 /* ... */로 둘러 싸여 있는 부분은 꼭 필요할것
   같은 부분만 남겨두고 전부 지웠습니다.
 #ifndef _SYS_WAIT_H
#define _SYS_WAIT_H     1
 #include <features.h>
 __BEGIN_DECLS
 #include <bits/types.h>
 #if defined __USE_XOPEN && !defined __pid_t_defined
typedef __pid_t pid_t;
# define __pid_t_defined
#endif
 #if !defined _STDLIB_H || !defined __USE_XOPEN
# include <bits/waitflags.h>
 # ifdef __USE_BSD
 #  if defined __GNUC__ && !defined __cplusplus
#   define __WAIT_INT(status)                                               
  (__extension__ ({ union { __typeof(status) __in; int __i; } __u;           
                    __u.__in = (status); __u.__i; }))
#  else
#   define __WAIT_INT(status)   (*(int *) &(status))
#  endif
 #  if !defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus
#   define __WAIT_STATUS        void *
#   define __WAIT_STATUS_DEFN   void *
#  else
 /* This works in GCC 2.6.1 and later.  */
typedef union
  {
    union wait *__uptr;
    int *__iptr;
  } __WAIT_STATUS __attribute__ ((__transparent_union__));
#   define __WAIT_STATUS_DEFN   int *
#  endif
 # else /* Don't use BSD.  */
 #  define __WAIT_INT(status)    (status)
#  define __WAIT_STATUS         int *
#  define __WAIT_STATUS_DEFN    int *
 # endif /* Use BSD.  */
 # include <bits/waitstatus.h>
 # define WEXITSTATUS(status)    __WEXITSTATUS(__WAIT_INT(status))
# define WTERMSIG(status)       __WTERMSIG(__WAIT_INT(status))
# define WSTOPSIG(status)       __WSTOPSIG(__WAIT_INT(status))
# define WIFEXITED(status)      __WIFEXITED(__WAIT_INT(status))
# define WIFSIGNALED(status)    __WIFSIGNALED(__WAIT_INT(status))
# define WIFSTOPPED(status)     __WIFSTOPPED(__WAIT_INT(status))
#endif  /* <stdlib.h> not included.  */
 #ifdef  __USE_BSD
# define WCOREFLAG              __WCOREFLAG
# define WCOREDUMP(status)      __WCOREDUMP(__WAIT_INT(status))
# define W_EXITCODE(ret, sig)   __W_EXITCODE(ret, sig)
# define W_STOPCODE(sig)        __W_STOPCODE(sig)
#endif
 #if defined __USE_SVID || defined __USE_XOPEN
typedef enum
{
  P_ALL,                /* Wait for any child.  */
  P_PID,                /* Wait for specified process.  */
  P_PGID                /* Wait for members of process group.  */
} idtype_t;
#endif
  이곳이 문제의 에러가 난곳입니다.
__WAIT_STATUS의 정의가 잘못되어 있는것 같습니다.
그래서 윗부분에 있는 define부분을 살펴보았지만 어떻게 잘못되었는지
알수가 없습니다.
 114 : extern __pid_t __wait (__WAIT_STATUS __stat_loc) __THROW;
115 : extern __pid_t wait (__WAIT_STATUS __stat_loc) __THROW;
 #ifdef  __USE_BSD
/* Special values for the PID argument to `waitpid' and `wait4'.  */
# define WAIT_ANY       (-1)    /* Any process.  */
# define WAIT_MYPGRP    0       /* Any process in my process group.  */
#endif
 extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options) __THROW;
 #if defined __USE_SVID || defined __USE_XOPEN
# define __need_siginfo_t
# include <bits/siginfo.h>
 extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
                   int __options) __THROW;
#endif
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 struct rusage;
 이곳도 에러로그에 나와 있는 곳입니다.
역시 이곳도 __WAIT_STATUS와 관련이 있는곳입니다.
 162 : extern __pid_t wait3 (__WAIT_STATUS __stat_loc, int __options,
                                                        struct rusage * __usage) __THROW;
#endif
 #ifdef __USE_BSD
 struct rusage;
 이곳도 에러로그에 나와 있는 곳입니다.
역시 이곳도 __WAIT_STATUS와 관련이 있는곳입니다.
 172 : extern __pid_t wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc, int __options,
                                                         struct rusage *__usage) __THROW;
#endif /* Use BSD.  */
  __END_DECLS
 #endif /* sys/wait.h  */
    </TD>
  </TR>
</TABLE>
</body>
</html>
--
이 곳에 서명을 적어주십시오.
이우정 입니다.
[관리자] 패스워드를 입력 하십시오. 답장이 존재하면 함께 삭제됩니다.[ 목록 | 이전 ]
패스워드:    

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