0

I've downloaded Bonjour following this answer - https://stackoverflow.com/a/19585202/492336

I'm trying to compile it for Windows, using VS2008, but I'm getting this error:

error C2016: C requires that a struct or union has at least one member

The error is at mDNSEmbeddedAPI.h, at this place in the code:

#define NSEC_MCAST_WINDOW_SIZE 32
typedef struct
{
    //domainname *next;
    //char bitmap[32];
} rdataNSEC;

Since this is a well-known library released by Apple, I'm surprised that it would fail to compile, provided they ship it as a Visual Studio project.

Is it because I'm using VS2008? The project file originally shipped was for an older version - I think VS2005?

Community
  • 1
  • 1
sashoalm
  • 75,001
  • 122
  • 434
  • 781
  • Did you ever figure this out? Beyond just the error above, I get all kinds of errors trying to compile mDNSResponder in Visual Studio. Was there a trick? – TTar Jan 22 '15 at 06:16
  • @TTar I did, in the end, yes, I even have the project buried somewhere. But if you're encountering problems, just ask them in a new post. – sashoalm Jan 22 '15 at 08:39

2 Answers2

3

Instead of

typedef struct
{
    //domainname *next;
    //char bitmap[32];
} rdataNSEC;

you should use

 typedef struct rdataNSEC rdataNSEC;
 struct rdataNSEC{ };
Dayal rai
  • 6,548
  • 22
  • 29
1

From the comments just above the declaration of rdataNSEC (in mDNSEmbeddedAPI.h):

// ... The following is just a palceholder
// and never used anywhere.

So why not just comment out the declaration?

alk
  • 69,737
  • 10
  • 105
  • 255