For$
<!-- begin site header -->
<div id=

Author Topic: error C2011 when compiling libevent  (Read 9197 times)

MechWarrior001

  • Newbie
  • *
  • Posts: 31
    • View Profile
error C2011 when compiling libevent
« on: November 12, 2011, 10:40:01 pm »
When I try to compile Libevent I get this error:

Code: [Select]
http.c(145): error C2011: 'addrinfo' : 'struct' type redefinition
which points me to this structure:

Code: [Select]
struct addrinfo {
int ai_family;
int ai_socktype;
int ai_protocol;
size_t ai_addrlen;
struct sockaddr *ai_addr;
struct addrinfo *ai_next;
};

It then tells me to look at ws2def.h and this is the declaration it has:

Code: [Select]
typedef struct addrinfo
{
    int                 ai_flags;       // AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST
    int                 ai_family;      // PF_xxx
    int                 ai_socktype;    // SOCK_xxx
    int                 ai_protocol;    // 0 or IPPROTO_xxx for IPv4 and IPv6
    size_t              ai_addrlen;     // Length of ai_addr
    char *              ai_canonname;   // Canonical name for nodename
    __field_bcount(ai_addrlen) struct sockaddr *   ai_addr;        // Binary address
    struct addrinfo *   ai_next;        // Next structure in linked list
}

I didn't make any modifications to Libevent, so I'm not sure what I should do.

Jailout2000

  • Newbie
  • *
  • Posts: 49
  • Enthusiast
    • View Profile
    • My Website
Re: error C2011 when compiling libevent
« Reply #1 on: November 14, 2011, 02:44:50 am »
Looks like a namespace problem.
Visit my website to see what's up with me.