Building kc master: ./.libs/libmapi.so: undefined reference to `KC::ECLocale::



  • I’m trying to build current git kc-master on CENTOS 6.8 with toolset…

    • gcc version 6.2.1 20160916 (Red Hat 6.2.1-3) (GCC)
    • GNU ld version 2.27-8.el6

    …and getting the below ld-error:

    Any idea where to put the lever, here?

    ./.libs/libmapi.so: undefined reference to `KC::ECLocale::operator=(KC::ECLocale const&)'
    ./.libs/libmapi.so: undefined reference to `KC::ECLocale::ECLocale()'
    ./.libs/libmapi.so: undefined reference to `KC::ECLocale::~ECLocale()'
    collect2: error: ld returned 1 exit status
    Makefile:3039: die Regel für Ziel „kopano-fsck“ scheiterte
    make[2]: *** [kopano-fsck] Fehler 1
    make[2]: Verzeichnis „/usr/src/kopano/kopanocore“ wird verlassen
    Makefile:4849: die Regel für Ziel „all-recursive“ scheiterte
    make[1]: *** [all-recursive] Fehler 1
    make[1]: Verzeichnis „/usr/src/kopano/kopanocore“ wird verlassen
    Makefile:1877: die Regel für Ziel „all“ scheiterte
    make: *** [all] Fehler 2
    
    # gcc -v
    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.2.1/lto-wrapper
    Target: x86_64-redhat-linux
    Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-6/root/usr --mandir=/opt/rh/devtoolset-6/root/usr/share/man --infodir=/opt/rh/devtoolset-6/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-default-libstdcxx-abi=gcc4-compatible --with-isl=/builddir/build/BUILD/gcc-6.2.1-20160916/obj-x86_64-redhat-linux/isl-install --enable-libmpx --with-mpc=/builddir/build/BUILD/gcc-6.2.1-20160916/obj-x86_64-redhat-linux/mpc-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
    Thread model: posix
    gcc version 6.2.1 20160916 (Red Hat 6.2.1-3) (GCC)
    
    
    

  • Kopano

    Hi

    @umgfoin said in Building kc master: ./.libs/libmapi.so: undefined reference to `KC::ECLocale:::

    ./.libs/libmapi.so: undefined reference to KC::ECLocale::operator=(KC::ECLocale const&)' ./.libs/libmapi.so: undefined reference toKC::ECLocale::ECLocale()’
    ./.libs/libmapi.so: undefined reference to `KC::ECLocale::~ECLocale()’

    As far as I remember you need libicu-devel to fix this. We should have that to autoconf.

    Bo



  • @bosim said in Building kc master: ./.libs/libmapi.so: undefined reference to `KC::ECLocale:::

    libicu-devel

    Bo, thanks a lot - worked!

    Additionally I needed:

    • ncurses-devel

    • in common/ECLogger.cpp:
      #include <climits>
      (defines UINT_MAX)

    • in common/ustringutil.cpp l. 1365/1366:
      const_cast <unsigned char>

    assert(wcslen(reinterpret_cast<wchar_t *>(const_cast<unsigned char*>(lpKey1))) == (cbKey1 / sizeof(wchar_t)) - 1);
    assert(wcslen(reinterpret_cast<wchar_t *>(const_cast<unsigned char*>(lpKey2))) == (cbKey2 / sizeof(wchar_t)) - 1);
    

    ++umgfoin.


  • Kopano

    @umgfoin said in Building kc master: ./.libs/libmapi.so: undefined reference to `KC::ECLocale:::

    Additionally I needed:

    ncurses-devel

    in common/ECLogger.cpp:
    #include <climits>
    (defines UINT_MAX)

    in common/ustringutil.cpp l. 1365/1366:
    const_cast <unsigned char>

    Wasn’t aware of the ncurses dependency. Wanted to remove it from my system to test out, but took out several more dependencies.

    The following 4 packages are going to be REMOVED:
        libxml2-devel ncurses-devel php5-devel readline-devel
    

    We are making libicu a hard requirement now, so in the future this error message you experienced should be gone and instead configure will complain about missing libicu-devel.

    Thanks for reminding me of this problem.

    Bo



  • Hi Bo,
    with today’s master we have a new (or related) problem building kopano-stats:

    ld: ECtools/stats/kopano_stats-stats.o: undefined reference to symbol ‘wtimeout’
    //lib64/libtinfo.so.5: error adding symbols: DSO missing from command line

    make  all-recursive
    make[1]: Verzeichnis „/usr/src/kopano/kopanocore“ wird betreten
    Making all in .
    make[2]: Verzeichnis „/usr/src/kopano/kopanocore“ wird betreten
      CXXLD  kopano-stats
    /opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.2.1/ld: ECtools/stats/kopano_stats-stats.o: undefined reference to symbol 'wtimeout'
    //lib64/libtinfo.so.5: error adding symbols: DSO missing from command line
    collect2: error: ld returned 1 exit status
    

  • Kopano

    @umgfoin said in Building kc master: ./.libs/libmapi.so: undefined reference to `KC::ECLocale:::

    ld: ECtools/stats/kopano_stats-stats.o: undefined reference to symbol ‘wtimeout’
    //lib64/libtinfo.so.5: error adding symbols: DSO missing from command line

    From what I can see this one should come from ncurses. I compiled the master yesterday without problems. When running configure do you see?

    ncurses libs	:	-L/usr/lib64/ncurses6 -lncursesw -ltinfo
    

    Bo



  • My entry looks different:

    ncurses libs    :       -lncursesw
    

    If I manually add -ltinfo to NCURSES_LIBS = in Makefile, it builds.


  • Kopano

    What does the following commands give you?

    11:02:47 bo@bo-suse ~/src/kopanocore (master) > ncursesw5-config --libs
    -lncursesw -ltinfo
    11:02:50 bo@bo-suse ~/src/kopanocore (master) > ncursesw6-config --libs
    -L/usr/lib64/ncurses6 -lncursesw -ltinfo
    

    Assume not the same as mine?

    Bo



  • Yes, just -lncursesw

    [tadao@ando kopanocore]# ncursesw5-config --libs
    -lncursesw
    [tadao@ando kopanocore]# ncursesw6-config --libs
    -bash: ncursesw6-config: Kommando nicht gefunden.
    

    “Kommando nicht gefunden” ~ command not found ;-)


  • Kopano

    @umgfoin said in Building kc master: ./.libs/libmapi.so: undefined reference to `KC::ECLocale:::

    Yes, just -lncursesw

    [tadao@ando kopanocore]# ncursesw5-config --libs
    -lncursesw
    [tadao@ando kopanocore]# ncursesw6-config --libs
    -bash: ncursesw6-config: Kommando nicht gefunden.
    

    “Kommando nicht gefunden” ~ command not found ;-)

    Yeah that’s the problem. But it used to work?

    Bo



  • @bosim
    Yes, used to work 2 days ago.

    My findings:
    libncurses links against libltinfo. If we don’t/ can’t explicitely specify this dependancy, newer toolchains can be called with ld-flag --copy-dt-needed-entries. As stated here, implicitely satisfying deep-link dependencies is no longer default behaviour for ld. The above flag forces this behaviour.

    With option LDFLAGS = -Xlinker --copy-dt-needed-entries in Makefile, the dependency is correctly resolved, again.
    Atleast valid for gcc version 6.2.1 20160916 (Red Hat 6.2.1-3) (GCC)
    ++umgfoin.


  • Kopano

    @umgfoin said in Building kc master: ./.libs/libmapi.so: undefined reference to `KC::ECLocale:::

    Yes, used to work 2 days ago.

    I looked for commits related to configure.ac, but couldn’t find anything that changed that. Did you get any updates from your distribution?

    Bo



  • @bosim said:

    Did you get any updates from your distribution?

    Nothing obvious - since 14.03.:

    MariaDB-xxx,
    php71,
    perl-XML-LibXML,
    perl-Test-Harness


  • Kopano

    @umgfoin said in Building kc master: ./.libs/libmapi.so: undefined reference to `KC::ECLocale:::

    @bosim said:

    Did you get any updates from your distribution?

    Nothing obvious - since 14.03.:

    MariaDB-xxx,
    php71,
    perl-XML-LibXML,
    perl-Test-Harness

    That’s wierd, I will create a JIRA ticket to investigate.
    https://jira.kopano.io/browse/KC-600


Log in to reply
 

Looks like your connection to Kopano Community Forum was lost, please wait while we try to reconnect.