All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srinivasa T N <seenutn@linux.vnet.ibm.com>
To: Himalay <himalay1995@gmail.com>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: error: dereferencing pointer to incomplete type and ICMP undeclared
Date: Sun, 29 Apr 2012 13:38:10 +0530	[thread overview]
Message-ID: <4F9CF6EA.2050405@linux.vnet.ibm.com> (raw)
In-Reply-To: <loom.20120427T083712-887@post.gmane.org>

On 04/27/2012 12:13 PM, Himalay wrote:
> I am using CYGWIN gcc compiler on Windows XP Prof. OS. I am getting following
> errors. I have defined __USE_BSD in ip_icmp.h.
> Anyone please help me in solving errors.
>
> recv_v4.c: In function `recv_v4':
> recv_v4.c:38: error: dereferencing pointer to incomplete type
> recv_v4.c:38: error: `ICMP_TIMXCEED' undeclared (first use in this function)
> recv_v4.c:38: error: (Each undeclared identifier is reported only once
> recv_v4.c:38: error: for each function it appears in.)
> recv_v4.c:39: error: dereferencing pointer to incomplete type
> recv_v4.c:39: error: `ICMP_TIMXCEED_INTRANS' undeclared (first use in this
> function)
> recv_v4.c:51: error: dereferencing pointer to incomplete type
> recv_v4.c:51: error: `ICMP_UNREACH' undeclared (first use in this function)
> recv_v4.c:61: error: dereferencing pointer to incomplete type
> recv_v4.c:61: error: `ICMP_UNREACH_PORT' undeclared (first use in this function)
> recv_v4.c:64: error: dereferencing pointer to incomplete type
> recv_v4.c:69: error: dereferencing pointer to incomplete type
> recv_v4.c:69: error: dereferencing pointer to incomplete type
>
> Following is the code:
>
> trace.h:
> #include<sys/socket.h>
> #include<sys/types.h>
> #include<sys/errno.h>
> #include<sys/time.h>
> #include<netinet/in.h>
> #include<netdb.h>
> #include<netinet/in_systm.h>
> #include<netinet/ip.h>
> #include<netinet/ip_icmp.h>
> #include<netinet/udp.h>
> #include<unistd.h>
> #include<stdio.h>
>
I think the above undefined(s) are in a header file which is above 
ip_icmp.h (in which you have define __USE_BSD) in the order of inclusion 
in the above list of inclusions.  Try to give as an -D__USE_BSD option 
to gcc.

Regards,
Seenu.


      reply	other threads:[~2012-04-29  8:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-27  6:43 error: dereferencing pointer to incomplete type and ICMP undeclared Himalay
2012-04-29  8:08 ` Srinivasa T N [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F9CF6EA.2050405@linux.vnet.ibm.com \
    --to=seenutn@linux.vnet.ibm.com \
    --cc=himalay1995@gmail.com \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.