While it compiles just fine with GCC 3.4.5, I get this error when building with GCC 4: i686-pc-linux-gnu-g++ -DNDEBUG -DBOOST_DISABLE_THREADS -DBOOST_SP_DISABLE_THREADS -O3 -march=pentium4 -pipe -fno-stack-protector-all -fno-stack-protector -fno-strict-aliasing -fno-omit-frame-pointer -fno-strict-aliasing -Wall -o monotone monotone-app_state.o monotone-commands.o monotone-diff_patch.o monotone-lua.o monotone-transforms.o monotone-update.o monotone-work.o monotone-cert.o monotone-database.o monotone-key_store.o monotone-file_io.o monotone-keys.o monotone-manifest.o monotone-packet.o monotone-sanity.o monotone-vocab.o monotone-rcs_file.o monotone-xdelta.o monotone-ui.o monotone-schema_migration.o monotone-constants.o monotone-netsync.o monotone-netcmd.o monotone-merkle_tree.o monotone-basic_io.o monotone-mkstemp.o monotone-lcs.o monotone-rcs_import.o monotone-revision.o monotone-change_set.o monotone-mt_version.o monotone-automate.o monotone-database_check.o monotone-epoch.o monotone-inodeprint.o monotone-selectors.o monotone-annotate.o monotone-restrictions.o monotone-hmac.o monotone-globish.o monotone-string_queue.o monotone-paths.o monotone-package_revision.o monotone-package_full_revision.o monotone-monotone.o monotone-main.o lib3rdparty.a libplatform.a -lz -ldl -lboost_regex -lboost_date_time -lboost_filesystem monotone-database.o: In function `Musing<hexenc<id> const>::gasp(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const': database.cc:(.gnu.linkonce.t._ZNK6MusingIK6hexencI2idEE4gaspERSs[Musing<hexenc<id> const>::gasp(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const]+0x2b): undefined reference to `void dump<id>(hexenc<id> const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)' monotone-database.o: In function `Musing<hexenc<id> >::gasp(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const': database.cc:(.gnu.linkonce.t._ZNK6MusingI6hexencI2idEE4gaspERSs[Musing<hexenc<id> >::gasp(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const]+0x2b): undefined reference to `void dump<id>(hexenc<id> const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)' collect2: ld returned 1 exit status make[2]: *** [monotone] Error 1 make[2]: Leaving directory `/gentoo/build/portage/monotone-0.25/work/monotone-0.25' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/gentoo/build/portage/monotone-0.25/work/monotone-0.25' make: *** [all] Error 2 !!! ERROR: dev-util/monotone-0.25 failed. Portage 2.1_pre3-r1 (default-linux/x86/2005.1, gcc-4.0.2, glibc-2.3.6-r1, 2.6.14.4 i686) ================================================================= System uname: 2.6.14.4 i686 Intel(R) Pentium(R) M processor 1500MHz Gentoo Base System version 1.12.0_pre12 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] dev-lang/python: 2.4.2 sys-apps/sandbox: 1.2.17 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1-r1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r3 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O3 -march=pentium4 -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/share/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d" CXXFLAGS="-O3 -march=pentium4 -fomit-frame-pointer -pipe" DISTDIR="/gentoo/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://ftp.easynet.nl/mirror/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://mirror.switch.ch/mirror/gentoo/ ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://ftp.easynet.nl/mirror/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://gentoo.osuosl.org" LINGUAS="de" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/gentoo/build" PORTDIR="/gentoo/portage" PORTDIR_OVERLAY="/gentoo/build/overlay" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 X Xaw3d a52 aac aalib acl acpi activefilter ada afs alsa aotuv arts asf audiofile avi bash-completion berkdb bitmap-fonts bluetooth browserplugin bzip2 caps cdb cdda cddb cdio cdparanoia cdr chipcard client-only cpudetection crypt cups dlloader doc dri dtaus dv dvd dvdread edl emacs emboss encode exif expat fam ffmpeg flac font-server foomaticdb ftp gd-external gdbm geldkarte gif glut gmp gnutls gphoto2 gpm gtk2 hardened hbci httpd icq idn imagemagick imap imlib ipppd irda irmc isdnlog jpeg jpeg2k kcal kde kerberos latex lcms ldap libg++ libwww lm_sensors lua lzo mad madwifi maildir mbox mime mng motif mozsvg mp3 mpeg mule musicbrainz nas ncurses nls no-old-linux noantlr nobcel nobeanutils nobsh nocommonslogging nocommonsnet nojdepend nojsch nojython nolog4j nooro noregexp norhino noxalan noxerces nptl nptlonly nsplugin objc ofx ogg oggvorbis openexr opengl pam pam_console pcre pdflib perl perlsuid pg-intdatetime pic png postgres ppds pppd pwdb python qt quicktime rdesktop readline real recode rtc savedconfig slang slp sms sockets socks5 speedo speex spell sql sse ssl stream subversion svg svga symlink sysfs tcpd tetex theora threads tiff toolbar truetype truetype-fonts type1-fonts udev unicode usb userlocales vcd vim-with-x vlm vorbis wifi win32codecs wxwindows xine xml2 xprint xscreensaver xv xvid xvmc zeroconf zlib elibc_glibc kernel_linux linguas_de userland_GNU" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, MAKEOPTS
This works fine for me. Have you tried recompiling everything with gcc-4? Perhaps you have something laying around that is linked to an old version of libstdc++?
A quick gcc-4.1 note (feel free to ignore): it fails with "-fno-stack-protector-all" being an unrecognized option (it's gone from gcc-4.1, as far as I know).
This works fine for me on gcc-4.0.2. I also added a test-flags statement into the ebuild, so its fine for 4.1 as well now.
Ok, this problem is present in amd64 with gcc 4.1.1. I have done 'emerge -e system' and emerge -e world twice. monotone is the only app not compiling with gcc 4.1.1. Anyone knows where this error is coming from?
*** Bug 145298 has been marked as a duplicate of this bug. ***