[cvsnt-dev] compiling mdns_apple.cpp on Mac OS X

Jens Miltner jum at mac.com
Fri Jan 12 10:04:01 GMT 2007


Community technical support mailing list was retired 2010 and replaced with a professional technical support team. For assistance please contact: Pre-sales Technical support via email to sales@march-hare.com.


Is anybody else having this problem:

When I try to build cvsnt, I get errors while compiling  
mdns_apple.cpp due to confliciting definitions of constants:

> apple/mdns_apple.cpp:36: error: conflicting declaration  
> 'kDNSServiceClass_IN'
> /usr/include/dns_sd.h:144: error: 'kDNSServiceClass_IN' has a  
> previous declaration as '<anonymous enum> kDNSServiceClass_IN'
> apple/mdns_apple.cpp:37: error: conflicting declaration  
> 'kDNSServiceType_A'
> /usr/include/dns_sd.h:149: error: 'kDNSServiceType_A' has a  
> previous declaration as '<anonymous enum> kDNSServiceType_A'
> apple/mdns_apple.cpp:38: error: conflicting declaration  
> 'kDNSServiceType_AAAA'
> /usr/include/dns_sd.h:176: error: 'kDNSServiceType_AAAA' has a  
> previous declaration as '<anonymous enum> kDNSServiceType_AAAA'
> apple/mdns_apple.cpp:39: error: conflicting declaration  
> 'kDNSServiceType_SRV'
> /usr/include/dns_sd.h:181: error: 'kDNSServiceType_SRV' has a  
> previous declaration as '<anonymous enum> kDNSServiceType_SRV'

Sure enough, the source file contains this definition:

> #ifdef __APPLE__
> // Bizarrely, OSX doesn't define these...
> enum
> {
>     kDNSServiceClass_IN       = 1,      /* Internet */
>     kDNSServiceType_A         = 1,      /* Host address. */
>     kDNSServiceType_AAAA      = 28,     /* Ip6 Address. */
>     kDNSServiceType_SRV       = 33,     /* Server Selection. */
> };
> #endif


However, in my system configuration (Mac OS X 10.4.7, Xcode 4.1), / 
usr/include/dns_sd.h DOES contain the constant definitions, so these  
are duplicates, which gcc-4.0 doesn't seem to like a lot...

So far I've been working around this by disabling mdns support, but I  
really think this should be solved somehow by either conditionally  
defining the constants in mdns_apple.cpp only if it's not defined by  
the system (would need some macro to test for, either from the system  
headers, or defined from the configure script, both of which I have  
no idea about) or, alternatively, require the latest SDKs for  
building csvnt (also probably not the perfect solution).

Since I'm using the "build-mac-multi" script in the osx directory, I  
wonder whether anybody else is having the same problem.

</jum>



More information about the cvsnt-dev mailing list