libnet 에러 좀 봐주세요...

popo의 이미지

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]#

codebank의 이미지

에러에보면 example1.c의 33번째에서 집중적인 포화를 받고 있는것 같은데
결국 이부분은 libnet.h와 stat.h와 연결이 되어져서 에러를 발생시킨다고
보이네요.
즉, libnet.h와 stat.h가 선언되거나 변수로 지정되기 이전에 example1.c의
구문자체가 문제를 일으켜서 나오는 문제 같습니다.
에러에 나온 33번째 줄이나 32번째 줄에 에러가 발생할 소지가 있는지 점검을
해보는게 좋을 겁니다.

그리고 좀더 직접적인 도움을 얻으시려면 에러 메시지와 함께 문제를 일으키는
소스(여기서는 example1.c의 33번째 위 아래로 5~10개 라인정도)를 같이
올려 놓으시면 좀더 정확한 도움을 얻을 수 있습니다.

------------------------------
좋은 하루 되세요.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.