James Bedford
James Bedford

Reputation: 28962

Compiling mDNSResponder for Linux?

I've been trying to compile the open source Bonjour framework developed by Apple for Linux. The problem I have is that when I run make with the option os=linux I get the following compile error:

struct sockaddr has no member named 'sa_len'

I've checked the struct sockddr and it indeed has no member named sa_len... So I'm confused as to why the framework is thinking that it should do!

Could anyone please give me some advice as to how I should be compiling mDNSResponder for Linux? Many thanks.

Upvotes: 1

Views: 2530

Answers (2)

lifeissweetgood
lifeissweetgood

Reputation: 151

The Linux implementation of sockaddr doesn't have sa_len as a member, but the FreeBSD version does. Apple's implementation is based off of the FreeBSD version (parts of OS X pull from FreeBSD and NetBSD), hence why you're receiving that error. You can use an #ifdef to workaround it or add the compilation flag, as previously suggested.

Upvotes: 1

n. m. could be an AI
n. m. could be an AI

Reputation: 119877

Looking in mDNSUNP.h one can see that if sa_len does not exist (such as on Linux), a macro NOT_HAVE_SA_LEN should be defined. If it's not defined in your case, try adding -DNOT_HAVE_SA_LEN to your compilation flags.

Upvotes: 1

Related Questions