# net-snmp won't compile

## Aitikin

I've tried just about everything I can think of, but I can't get net-snmp to compile.  Here's the error:

```
x86_64-pc-linux-gnu-gcc -I../include -I. -I../agent -I../agent/mibgroup -I../snmplib -DDEBUGGING -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib64/perl5/5.8.8/x86_64-linux/CORE -DINET6 -march=athlon64 -Os -pipe -Dlinux -c snmp_perl.c  -fPIC -DPIC -o .libs/snmp_perl.lo

snmp_perl.c:88:2: error: #error embedded perl broken

make[1]: *** [snmp_perl.lo] Error 1

make[1]: Leaving directory `/var/tmp/portage/net-analyzer/net-snmp-5.3.1-r1/work/net-snmp-5.3.1/agent'

make: *** [subdirs] Error 1

!!! ERROR: net-analyzer/net-snmp-5.3.1-r1 failed.

Call stack:

  ebuild.sh, line 1568:   Called dyn_compile

  ebuild.sh, line 937:   Called src_compile

  net-snmp-5.3.1-r1.ebuild, line 113:   Called die

```

I've tried revdep-rebuild and I did an emerge -ave world (partially because of this) because I wanted to optimize everything a bit, but it wasn't working before hand either.

----------

## moocha

Have you set the minimal USE flag globally in make.conf or on any perl packages? If so, don't, re-emerge libperl and perl and try again.

Also, please get used to providing

```
emerge --info
```

output by default in cases like this. That will cut down on redundant posts asking to provide it.

----------

## Aitikin

Here's emerge --info:

```
Portage 2.1.2_pre3-r9 (default-linux/amd64/2006.0, gcc-4.1.1, glibc-2.5-r0, 2.6.17-gentoo-r8 x86_64)

=================================================================

System uname: 2.6.17-gentoo-r8 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4200+

Gentoo Base System version 1.12.5

Last Sync: Thu, 26 Oct 2006 06:30:01 +0000

ccache version 2.4 [disabled]

app-admin/eselect-compiler: [Not Present]

dev-java/java-config: 1.3.7, 2.0.30

dev-lang/python:     2.4.3-r4

dev-python/pycrypto: 2.0.1-r5

dev-util/ccache:     2.4-r6

dev-util/confcache:  [Not Present]

sys-apps/sandbox:    1.2.18.1

sys-devel/autoconf:  2.13, 2.60

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10

sys-devel/binutils:  2.17

sys-devel/gcc-config: 1.3.14

sys-devel/libtool:   1.5.22

virtual/os-headers:  2.6.17-r1

ACCEPT_KEYWORDS="amd64 ~amd64"

AUTOCLEAN="yes"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-march=athlon64 -Os -pipe -msse3 -mmmx -msse2"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"

CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"

CXXFLAGS="-march=athlon64 -Os -pipe -msse3 -mmmx -msse2"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig distlocks metadata-transfer parallel-fetch sandbox sfperms strict"

GENTOO_MIRRORS="http://gentoo.cites.uiuc.edu/pub/gentoo/ ftp://gentoo.cites.uiuc.edu/pub/gentoo/ "

LDFLAGS="-Wl,-O1 -Wl,--as-needed,--sort-common"

MAKEOPTS="-j3"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage /usr/portage/local/layman/portage-xgl"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="amd64 X a52 aac acpi aim alsa amr arts artswrappersuid asf automount berkdb bitmap-fonts bonjour cdinstall cdr cdrom chroot cli cracklib crypt css cups daap dbus debug dlloader dri dts dvd dvdr dvdread eds elibc_glibc emboss emul-linux-x86 encode esd fat ffmpeg firefox flac flash font-server foomaticdb fortran gcj gif gimp gimpprint gnustep gpm gsnd gstreamer gtk gtk2 h323 hal hpn id3 ieee1394 imlib input_devices_keyboard input_devices_mouse ipod ipv6 isdnlog jack java javascript jfs jikes jpeg kde kdeenablefinal kdehiddenvisibility kernel_linux kipi layout-osx-like lzw lzw-tiff mad matroska memlimit mikmod mjpeg mozsvg mp3 mpeg mpeg2 mplayer ncurses neXt nforce2 nls nocd nptl nptlonly nsplugin ntfs nvidia objc objc++ objc-gc offensive ogg opengl oss pam pcre pda pdf perl png ppds pppd python qt3 quicktime readline reflection reiserfs rtsp samba scanner sdl server session sftplogging slp smp snmp speex spell spl ssl startup-notification svg symlink tcpd theora thesaurus threads tiff truetype-fonts type1-fonts unicode usb userland_GNU v4l v4l2 vcd vfat video_cards_fbdev video_cards_mesa video_cards_nv video_cards_nvidia video_cards_vesa vorbis wifi wma wmf x11vnc x264 xcomposite xfs xinerama xml xorg xpm xsl xv xvid xvmc zeroconf zlib"

Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS

```

And here's the output of emerge -pv perl libperl

```

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] dev-lang/perl-5.8.8-r2  USE="berkdb debug -build -doc -gdbm -ithreads -perlsuid" 0 kB 

[ebuild   R   ] sys-devel/libperl-5.8.8-r1  USE="berkdb debug -gdbm -ithreads" 0 kB 

Total size of downloads: 0 kB
```

I don't have minimal on anything, global or otherwise.

----------

## moocha

Can't reproduce it, sorry, and I don't have an unstable system functional at the moment since I suspect it's related to ~arch.

net-analyzer/net-snmp-5.2.1.2-r1 merges just fine. Is there any reason you would need 5.3.1 specifically? If not, you may want to mask >=net-analyzer/net-snmp-5.2.1.2-r1 and use the stable branch of net-snmp.

----------

## Janne Pikkarainen

... or if you don't need the Perl support for SNMP, you might want to emerge net-snmp without perl USE flag.

----------

## Aitikin

 *Janne Pikkarainen wrote:*   

> ... or if you don't need the Perl support for SNMP, you might want to emerge net-snmp without perl USE flag.

 

Good point...I do have no real need for Perl support, so now I'm emerging it without the -Perl USE flag.

----------

## Aitikin

Didn't work.  Here's the output with -perl as a use flag:

```
./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_table_dataset_add_row'

../snmplib/.libs/libnetsnmp.so: undefined reference to `EVP_DigestInit'

./.libs/libnetsnmpmibs.so: undefined reference to `dlerror'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_cache_check_and_reload'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_register_scalar'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_tdata_register'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_tdata_add_row'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_tdata_create_table'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_insert_iterator_context'

../snmplib/.libs/libnetsnmp.so: undefined reference to `EVP_DigestFinal'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_table_data_set_get_next_row'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_table_data_set_find_column'

../snmplib/.libs/libnetsnmp.so: undefined reference to `EVP_DigestFinal_ex'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_insert_table_row'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_create_watcher_info'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_table_data_remove_and_delete_row'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_table_data_add_row'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_get_row_merge_handler'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_cache_check_expired'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_register_instance'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_row_merge_status_last'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_table_dataset_add_index'

../snmplib/.libs/libnetsnmp.so: undefined reference to `AES_set_encrypt_key'

../snmplib/.libs/libnetsnmp.so: undefined reference to `EVP_md5'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_cache_create'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_create_table_data'

./.libs/libnetsnmpagent.so: undefined reference to `hosts_ctl'

./.libs/libnetsnmpmibs.so: undefined reference to `sensors_get_label'

../snmplib/.libs/libnetsnmp.so: undefined reference to `HMAC'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_container_table_row_extract'

./.libs/libnetsnmpmibs.so: undefined reference to `dlclose'

../snmplib/.libs/libnetsnmp.so: undefined reference to `EVP_MD_CTX_cleanup'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_register_table_iterator'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_register_watched_scalar'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_baby_steps_access_multiplexer_get'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_register_table_data'

../snmplib/.libs/libnetsnmp.so: undefined reference to `SSLeay'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_tdata_row_next'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_cache_get_head'

../snmplib/.libs/libnetsnmp.so: undefined reference to `EVP_sha1'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_bulk_to_next_fix_requests'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_tdata_row_get_byoid'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_extract_table_info'

./.libs/libnetsnmpmibs.so: undefined reference to `sensors_init'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_create_table_data_set'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_set_row_column'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_register_table'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_tdata_extract_row'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_tdata_create_row'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_cache_handler_get'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_extract_table_row_data'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_table_data_set_get_first_row'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_container_table_handler_get'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_cache_is_valid'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_table_set_num_rows'

./.libs/libnetsnmpmibs.so: undefined reference to `dlopen'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_cache_find_by_oid'

../snmplib/.libs/libnetsnmp.so: undefined reference to `EVP_MD_CTX_init'

./.libs/libnetsnmpagent.so: undefined reference to `netsnmp_register_old_api'

../snmplib/.libs/libnetsnmp.so: undefined reference to `EVP_DigestUpdate'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_tdata_delete_row'

./.libs/libnetsnmpagent.so: undefined reference to `netsnmp_register_null'

../snmplib/.libs/libnetsnmp.so: undefined reference to `RAND_bytes'

./.libs/libnetsnmpmibs.so: undefined reference to `dlsym'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_tdata_row_get_byidx'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_tdata_row_entry'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_tdata_row_next_byidx'

./.libs/libnetsnmpmibs.so: undefined reference to `sensors_get_detected_chips'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_row_merge_status_first'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_get_cache_handler'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_insert_tdata_row'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_table_set_add_default_row'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_tdata_compare_subtree_idx'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_register_read_only_counter32_instance_context'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_register_num_file_instance'

./.libs/libnetsnmpagent.so: undefined reference to `netsnmp_get_bulk_to_next_handler'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_register_watched_spinlock'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_register_scalar_group'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_create_table_data_row'

../snmplib/.libs/libnetsnmp.so: undefined reference to `DES_cbc_encrypt'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_tdata_extract_entry'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_register_table_data_set'

./.libs/libnetsnmpagent.so: undefined reference to `netsnmp_init_helpers'

./.libs/libnetsnmpmibs.so: undefined reference to `sensors_get_feature'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_baby_steps_handler_get'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_tdata_remove_and_delete_row'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_table_helper_add_indexes'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_extract_iterator_context'

./.libs/libnetsnmpmibs.so: undefined reference to `sensors_get_all_features'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_table_dataset_remove_and_delete_row'

../snmplib/.libs/libnetsnmp.so: undefined reference to `DES_ncbc_encrypt'

../snmplib/.libs/libnetsnmp.so: undefined reference to `DES_key_sched'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_tdata_row_first'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_register_ulong_instance_context'

./.libs/libnetsnmpmibs.so: undefined reference to `netsnmp_container_table_row_insert'

./.libs/libnetsnmpagent.so: undefined reference to `netsnmp_register_null_context'

../snmplib/.libs/libnetsnmp.so: undefined reference to `AES_cfb128_encrypt'

collect2: ld returned 1 exit status

make[1]: *** [snmpd] Error 1

make[1]: Leaving directory `/var/tmp/portage/net-analyzer/net-snmp-5.3.1-r1/work/net-snmp-5.3.1/agent'

make: *** [subdirs] Error 1

!!! ERROR: net-analyzer/net-snmp-5.3.1-r1 failed.

Call stack:

ebuild.sh, line 1568: Called dyn_compile

ebuild.sh, line 937: Called src_compile

net-snmp-5.3.1-r1.ebuild, line 113: Called die

!!! emake failed

!!! If you need support, post the topmost build error, and the call stack if relevant.

Done.
```

----------

## moocha

I suggest trying my solution. net-snmp is notorious for being, er, brittle when emerging.

----------

