Menu

#11 compilation error

closed
Tracker (13)
5
2009-10-30
2009-10-29
Anonymous
No

I have downloaded the latest source code, but it doesn't compile.
Previously (October 5th) I have successfully compiled xbtt but the source was very old (half a year or older) and gcc was 3.4.6, now gcc is 4.3.4.

Also I have tried to compile with these flags:
-lstdc++
-Wno-deprecated
but get the same error

Error starts as:
/tmp/ccfFmADt.o: In function `Cdatabase::Cdatabase()':
database.cpp:(.text+0xfa): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
/tmp/ccfFmADt.o: In function `Cdatabase::Cdatabase()':
database.cpp:(.text+0x15a): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
/tmp/ccfFmADt.o: In function `Cdatabase::~Cdatabase()':
database.cpp:(.text+0x1cf): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
/tmp/ccfFmADt.o: In function `Cdatabase::~Cdatabase()':
database.cpp:(.text+0x25f): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
/tmp/ccfFmADt.o: In function `Cdatabase::open(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
database.cpp:(.text+0x387): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
/tmp/ccfFmADt.o:database.cpp:(.text+0x42a): more undefined references to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage' follow
/tmp/ccfFmADt.o: In function `Cdatabase::query(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
database.cpp:(.text+0x549): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
database.cpp:(.text+0x580): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
database.cpp:(.text+0x5f6): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
database.cpp:(.text+0x60f): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
database.cpp:(.text+0x626): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
database.cpp:(.text+0x693): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
database.cpp:(.text+0x96b): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'

Full error log in attachment.

My system info:
# ls -la /usr/lib | grep libst
-rw-r--r-- 1 root root 957 Окт 28 01:54 libstdc++.la
lrwxrwxrwx 1 root root 14 Окт 28 00:47 libstdc++.so -> libstdc++.so.5*
lrwxrwxrwx 1 root root 18 Окт 28 01:44 libstdc++.so.5 -> libstdc++.so.5.0.7*
-rwxr-xr-x 1 root root 752964 Окт 28 01:44 libstdc++.so.5.0.7*

# gcc -v
Спецификации прочитаны из /usr/lib/gcc/i486-pc-linux-gnu/4.3.4/specs
Целевая архитектура: i486-pc-linux-gnu
Параметры конфигурации: /var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/configure --prefix=/usr --bindir=/usr/i486-pc-linux-gnu/gcc-bin/4.3.4 --includedir=/usr/lib/gcc/i486-pc-linux-gnu/4.3.4/include --datadir=/usr/share/gcc-data/i486-pc-linux-gnu/4.3.4 --mandir=/usr/share/gcc-data/i486-pc-linux-gnu/4.3.4/man --infodir=/usr/share/gcc-data/i486-pc-linux-gnu/4.3.4/info --with-gxx-include-dir=/usr/lib/gcc/i486-pc-linux-gnu/4.3.4/include/g++-v4 --host=i486-pc-linux-gnu --build=i486-pc-linux-gnu --disable-altivec --disable-fixed-point --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --disable-libgcj --with-arch=i486 --enable-languages=c,c++,treelang --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.3.4 p1.0, pie-10.1.5'
Модель многопоточности: posix
gcc версия 4.3.4 (Gentoo 4.3.4 p1.0, pie-10.1.5)

# uname -a
Linux router 2.6.28-hardened-r9 #2 Wed Oct 28 13:59:00 MSK 2009 i686 Intel(R) Celeron(TM) CPU 1400MHz GenuineIntel GNU/Linux

# emerge --info
Portage 2.1.6.13 (hardened/linux/x86/10.0, gcc-4.3.4, glibc-2.9_p20081201-r2, 2.6.28-hardened-r9 i686)
=================================================================
System uname: Linux-2.6.28-hardened-r9-i686-Intel-R-_Celeron-TM-_CPU_1400MHz-with-gentoo-1.12.11.1
Timestamp of tree: Thu, 29 Oct 2009 02:15:01 +0000
ccache version 2.4 [enabled]
app-shells/bash: 4.0_p28
dev-lang/python: 2.5.4-r3, 2.6.2-r1
dev-python/pycrypto: 2.0.1-r8
dev-util/ccache: 2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox: 1.6-r2
sys-devel/autoconf: 2.63-r1
sys-devel/automake: 1.7.9-r1, 1.9.6-r2, 1.10.2
sys-devel/binutils: 2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool: 2.2.6a
virtual/os-headers: 2.6.30-r1
ACCEPT_KEYWORDS="x86"
CBUILD="i486-pc-linux-gnu"
CFLAGS="-march=pentium3 -O2 -pipe -mmmx -msse"
CHOST="i486-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=pentium3 -O2 -pipe -mmmx -msse"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache collision-protect distlocks fixpackages nodoc parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS=" http://mirror.yandex.ru/gentoo-distfiles/ http://ftp.corbina.net/pub/Linux/gentoo/ http://gentoo.supp.name/ "
LANG="ru_RU.UTF-8"
LC_ALL=""
LDFLAGS="-Wl,-O1"
LINGUAS="ru en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://mirror.yandex.ru/gentoo-portage"
USE="7zip acl berkdb bzip2 cli cracklib crypt cups dri gdbm hardened iconv isdnlog mmx modules mudflap ncurses nls nptl nptlonly openmp pam pcre perl pic pppd python readline reflection session spl sse ssl symlink sysfs tcpd unicode urandom x86 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru en" USERLAND="GNU" VIDEO_CARDS="fglrx radeon vesa"
Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Discussion

  • Olaf van der Spek

    Looks like part of the standard library doesn't get linked. This should happen automatically. My guess is a corrupt gcc installation. You could try the compile on another system.

     
  • Anonymous

    Anonymous - 2009-10-29

    Toolchain recompilation does not helped - I have got the same error.
    How I can check which library is not linked by gcc?

    But if gcc can not link some library's how he can recompiled all system (over a 300 packages) without any errors?
    Maybe it is only a problem of hardened Gentoo?

    OK, I have tried compile xbtt at my desktop PC with Ubuntu 9.04 (amd64) - it was compiled without errors and in a few seconds. At Gentoo this process takes up several minutes (with errors).
    But I don't need xbtt at Ubuntu, I need it at Gentoo.

     
  • Olaf van der Spek

    I don't know, but it's not a XBTT issue.

     
  • Anonymous

    Anonymous - 2009-10-29

    OK, I understand, but maybe you know library's needed to compile xbtt? I will try check which not linked...

     
  • Olaf van der Spek

    See make.sh. Others should be linked automatically.

     
  • Anonymous

    Anonymous - 2009-10-29

    I found where the error:
    don't know why, but I have two libstdc++.so library's in system. One in /usr/lib/libstdc++.so (linked to libstdc++.so.5 from libstdc++-v3) and one in gcc 4.3.4 in /usr/lib/gcc/i486-pc-linux-gnu/4.3.4/
    I have removed link in /usr/lib/ and xbtt compiled!
    I found the solution which helped me resolve the problem: http://bugs.gentoo.org/show_bug.cgi?id=69475#c16
    Sorry to trouble you and thank you for help :)

     

Log in to post a comment.

MongoDB Logo MongoDB