我已经按照这个答案下载了 Bonjour - https://stackoverflow.com/a/19585202/492336
我正在尝试使用 VS2008 为 Windows 编译它,但出现此错误:
error C2016: C requires that a struct or union has at least one member
错误在 mDNSEmbeddedAPI.h
,在代码的这个地方:
#define NSEC_MCAST_WINDOW_SIZE 32
typedef struct
{
//domainname *next;
//char bitmap[32];
} rdataNSEC;
由于这是 Apple 发布的知名库,我很惊讶它无法编译,前提是他们将其作为 Visual Studio 项目发布。
是不是因为我用的是VS2008?最初发布的项目文件是针对旧版本的 - 我认为是 VS2005?
最佳答案
代替
typedef struct
{
//domainname *next;
//char bitmap[32];
} rdataNSEC;
你应该使用
typedef struct rdataNSEC rdataNSEC;
struct rdataNSEC{ };
关于c - 错误 C2016 : C requires that a struct or union has at least one member (while compiling Bonjour),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19590246/