On Dec 23, 2014, at 4:12 AM, Jos van de Ven <[email protected]> wrote:
>> It does here (MacOSX 10.9.5, and gcc 4.2.1 - the current compiler Apple ship 
>> with Xcode).

Apple's Xcode comes with both gcc 4.2.1 and Clang 3.5; clang has become the 
default compiler.

> It doesn’t on my system: Yosemite 10.10.1 and Xcode 6.1.1

I'm running approximately that-- well, I've updated to Xcode 6.2, but it 
doesn't change
anything relevant to this situation.  Both:

   env CC=cc ./configure
   env CC=gcc ./configure

...produce a working ntpsnmpd binary from ntp-4.2.8p1 sources.

>  CCLD     ntpsnmpd
> Undefined symbols for architecture x86_64:
>  "_debug", referenced from:
>      _setdebug in libntpq.a(libntpq_a-libntpq.o)
>      _doqueryex in libntpq.a(libntpq_a-libntpq.o)
>      _openhost in libntpq.a(libntpq_a-libntpq.o)
>      _sendpkt in libntpq.a(libntpq_a-libntpq.o)
>      _MD5auth_setkey in libntp.a(authkeys.o)
>      _auth_agekeys in libntp.a(authkeys.o)
>      _addto_syslog in libntp.a(msyslog.o)
>      ...
>  "_lib_nextbuf", referenced from:
>      _nntohost_col in libntpq.a(libntpq_a-libntpq.o)
>      _trunc_left in libntpq.a(libntpq_a-libntpq.o)
>      _trunc_right in libntpq.a(libntpq_a-libntpq.o)
>      _nntohostp in libntpq.a(libntpq_a-libntpq.o)
>      _dolfptoa in libntp.a(dolfptoa.o)
>      _common_prettydate in libntp.a(prettydate.o)
>      _refnumtoa in libntp.a(refnumtoa.o)
>      ...
>  "_lib_stringbuf", referenced from:
>      _nntohost_col in libntpq.a(libntpq_a-libntpq.o)
>      _trunc_left in libntpq.a(libntpq_a-libntpq.o)
>      _trunc_right in libntpq.a(libntpq_a-libntpq.o)
>      _nntohostp in libntpq.a(libntpq_a-libntpq.o)
>      _dolfptoa in libntp.a(dolfptoa.o)
>      _common_prettydate in libntp.a(prettydate.o)
>      _refnumtoa in libntp.a(refnumtoa.o)
>      ...
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see 
> invocation)
> make[3]: *** [ntpsnmpd] Error 1
> make[2]: *** [all] Error 2
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2
> 
> I tried to compile without ntpsnmpd but then I get this error elsewhere. 

You're using clang to link, at least, and it looks like you might be compiling
or pulling in a 32-bit version of the SNMP library, rather than a native
64-bit (aka AMD64 or x86_64) version.

Are you trying to compile a 32-bit binary intentionally?

Is the system library providing SNMP symbols OK?
It should contain both 32-bit and 64-bit versions:

% file 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib/libnetsnmp.dylib
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib/libnetsnmp.dylib:
 Mach-O universal binary with 2 architectures
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib/libnetsnmp.dylib
 (for architecture x86_64): Mach-O 64-bit dynamically linked shared library 
stub x86_64
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib/libnetsnmp.dylib
 (for architecture i386):   Mach-O dynamically linked shared library stub i386

Regards,
-- 
-Chuck

_______________________________________________
pool mailing list
[email protected]
http://lists.ntp.org/listinfo/pool

Reply via email to