Building net-mgmt/net-snmp fails

Sean McAfee smcafee at
Fri May 7 14:52:47 UTC 2010

Olivier Cochard-Labbé wrote:
> Hi all,
> since some days, I can't compile net-snmp on my FreeBSD 8-Stable using
> the default make value.
> I've got this error message:
> net-snmp- -lwrap -lkvm /usr/ports/net-mgmt
> /net-snmp/work/net-snmp- -ldevstat
> ../snmplib/.libs/ -lcrypto -lelf -lssp_nonshared
> -Wl,--rpath -Wl,/usr/local/lib
> ./.libs/ undefined reference to `exp'
> Does anyone meet the same problem ?

On 8.0p2 amd64, I actually get:

host/hr_system.c: In function 'var_hrsys':
host/hr_system.c:290: warning: passing argument 4 of 'sysctl' from 
incompatible pointer type
host/hr_system.c: In function 'count_users':
host/hr_system.c:617: error: 'struct utmpx' has no member named 'ut_name'

But if I change:

.if ${OSVERSION} >= 900007
         ${REINPLACE_CMD} -e 's!utmp_p->ut_name!utmp_p->ut_user!' 

to ".if ${OSVERSION} >= 800076"

I then get similar errors to yours:

./.libs/ undefined reference to `setutxent'
./.libs/ undefined reference to `endutxent'
./.libs/ undefined reference to `getutxent'
./.libs/ undefined reference to `exp'

I just started looking into this, I'm going to try the library chase 
that Boris mentioned, but may not be able to get to it for a couple of days.

Sean McAfee
Senior Systems Engineer

More information about the freebsd-ports mailing list