libnet 에러 좀 봐주세요...
packetfactory에서 libnet 소스를 받아서 컴파일 하려는데 안돼서
rpm(libnet-1.0.1b-1.i386.rpm)으로 설치했더니 설치는 잘 되었습니다.
그런데 packetfactory에서 받은 예제소스를 컴파일 하려니 아래와 같은 에러가 뜹니다. 옵션도 잘해준거같기도한데 libnet소스를 make할때 나오는 에러랑 비슷한 에러가 나오네요..
왜 이런지..해결책은 무엇인지 아시는분있으시면 작은 코멘트라도 반기겠습니다.
제 시스템 환경도 올립니다..
cpu - x86
gcc version 2.96
glibc-2.2.4-5
redhat linux(kenel-2.4.7-2)
[root@localhost libnet]# gcc -Wall -g `libnet-config --defines` ./example1.c -o example1 `libnet-config --libs`
In file included from /usr/include/libnet.h:45,
from ./example1.c:33:
/usr/include/sys/stat.h:1: parse error before `1991'
In file included from /usr/include/sys/stat.h:98,
from /usr/include/libnet.h:45,
from ./example1.c:33:
/usr/include/bits/stat.h:75: parse error before `}'
In file included from /usr/include/libnet.h:45,
from ./example1.c:33:
/usr/include/sys/stat.h:201: warning: `struct stat' declared inside parameter list
/usr/include/sys/stat.h:201: warning: its scope is only this definition or declaration, which is probably not what you want.
/usr/include/sys/stat.h:205: warning: `struct stat' declared inside parameter list
/usr/include/sys/stat.h:229: warning: `struct stat' declared inside parameter list
/usr/include/sys/stat.h:307: warning: `struct stat' declared inside parameter list
/usr/include/sys/stat.h:309: warning: `struct stat' declared inside parameter list
/usr/include/sys/stat.h:311: warning: `struct stat' declared inside parameter list
/usr/include/sys/stat.h:345: warning: `struct stat' declared inside parameter list
/usr/include/sys/stat.h:346: conflicting types for `stat'
/usr/include/sys/stat.h:201: previous declaration of `stat'
/usr/include/sys/stat.h: In function `stat':
/usr/include/sys/stat.h:347: warning: passing arg 3 of `__xstat' from incompatible pointer type
/usr/include/sys/stat.h: At top level:
/usr/include/sys/stat.h:352: warning: `struct stat' declared inside parameter list
/usr/include/sys/stat.h:353: conflicting types for `lstat'
/usr/include/sys/stat.h:229: previous declaration of `lstat'
/usr/include/sys/stat.h: In function `lstat':
/usr/include/sys/stat.h:354: warning: passing arg 3 of `__lxstat' from incompatible pointer type
/usr/include/sys/stat.h: At top level:
/usr/include/sys/stat.h:358: warning: `struct stat' declared inside parameter list
/usr/include/sys/stat.h:359: conflicting types for `fstat'
/usr/include/sys/stat.h:205: previous declaration of `fstat'
/usr/include/sys/stat.h: In function `fstat':
/usr/include/sys/stat.h:360: warning: passing arg 3 of `__fxstat' from incompatible pointer type
[root@localhost libnet]#
소스가 필요하지 않을까요?
에러에보면 example1.c의 33번째에서 집중적인 포화를 받고 있는것 같은데
결국 이부분은 libnet.h와 stat.h와 연결이 되어져서 에러를 발생시킨다고
보이네요.
즉, libnet.h와 stat.h가 선언되거나 변수로 지정되기 이전에 example1.c의
구문자체가 문제를 일으켜서 나오는 문제 같습니다.
에러에 나온 33번째 줄이나 32번째 줄에 에러가 발생할 소지가 있는지 점검을
해보는게 좋을 겁니다.
그리고 좀더 직접적인 도움을 얻으시려면 에러 메시지와 함께 문제를 일으키는
소스(여기서는 example1.c의 33번째 위 아래로 5~10개 라인정도)를 같이
올려 놓으시면 좀더 정확한 도움을 얻을 수 있습니다.
------------------------------
좋은 하루 되세요.
댓글 달기