error: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'



  • Dear All:
    i have been successfully install Qt5.7 on my raspberry pi 3 with cross compile method following the steps :http://wiki.qt.io/RaspberryPi2EGLFS
    but now I have meet a problem, as my project include libactivemq-cpp. so i install it on my rpi3 and sync to my host, than there is an error:
    /home/tong/raspi/sysroot/usr/lib/libactivemq-cpp.so:-1: error: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'
    i search the result,it seems that gcc on rpi3 is newer complier and my cross compiler is old version, i check the compiler :
    G++ on my rpi3 v4.9.2 , the g++ configuered on qtcreator v4.8.3,
    and there is no new version tool on https://github.com/raspberrypi/tool, what should i do?
    or is there any other problems ? thank you !



  • @JiujiuTong said in error: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20':

    Dear All:
    i have been successfully install Qt5.7 on my raspberry pi 3 with cross compile method following the steps :http://wiki.qt.io/RaspberryPi2EGLFS
    but now I have meet a problem, as my project include libactivemq-cpp. so i install it on my rpi3 and sync to my host, than there is an error:
    /home/tong/raspi/sysroot/usr/lib/libactivemq-cpp.so:-1: error: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'
    i search the result,it seems that gcc on rpi3 is newer complier and my cross compiler is old version, i check the compiler :
    G++ on my rpi3 v4.9.2 , the g++ configuered on qtcreator v4.8.3,
    and there is no new version tool on https://github.com/raspberrypi/tool, what should i do?
    or is there any other problems ? thank you !

    @dheerendra @jsulm @SGaist
    any suggestions? thank you !


  • Lifetime Qt Champion

    Hi,

    Did you try with the arm-rpi-4.9.3-linux-gnueabihf that's in the same repository ?



  • @SGaist
    @jsulm

    i first set the compiler path to gcc-linaro-arm-linux-gnueabihf-raspbian-x64, then i found the issue, i try to set it to arm-4.9.3-linux-gnueabihf in qtcreator, but i find the compiler path is still: ~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++
    even i reinstall the qtcreator and reconfigure the compiler(i find the compiler path in the file" makefile"),is there any other ways can set the compiler to arm-4.9.3-linux-gnueabihf ?
    another info:
    i try to replace the gcc-linaro-arm-linux-gnueabihf-raspbian-x64 with arm-4.9.3-linux-gnueabihf in makefile and run build project in qtcreator, there is an error :/home/tong/raspi/sysroot/usr/include/features.h:374: error: sys/cdefs.h: No such file or directory

    include <sys/cdefs.h>

                         ^


  • @SGaist @jsulm
    when i set compiler to arm-rpi-4.9.3-linux-gnueabihf.
    there is an waring::
    :-1: warning: "/home/tong/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++" is used by qmake, but "/home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++" is configured in the kit.
    Please update your kit or choose a mkspec for qmake that matches your target environment better.
    and the makefile qtcreator created still contains the gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++


  • Lifetime Qt Champion

    You should re-cross-compile Qt with that compiler directly.



  • @SGaist
    well , i tried it , here is configure error:
    /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -marm -mthumb-interwork -mfpu=neon-vfpv4 -mtune=cortex-a7 -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/home/tong/raspi/sysroot -g -Wall -W -fPIC -I. -I../../mkspecs/devices/linux-rasp-pi2-g++ -o arch.o arch.cpp
    In file included from /home/tong/raspi/sysroot/usr/include/stdio.h:27:0,
    from arch.cpp:43:
    /home/tong/raspi/sysroot/usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory

    include <sys/cdefs.h>

                         ^
    

    compilation terminated.
    make: *** [arch.o] Error 1
    Makefile:199: recipe for target 'arch.o' failed
    Unable to determine architecture!

    Could not determine the target architecture!
    Turn on verbose messaging (-v) to see the final report.
    Determining architecture... ()
    g++ -c -pipe -g -Wall -W -fPIC -I. -I../../mkspecs/linux-g++ -o arch.o arch.cpp
    g++ -o arch arch.o
    Found architecture in binary
    CFG_HOST_ARCH="x86_64"
    CFG_HOST_CPUFEATURES=" mmx sse sse2"
    System architecture: 'unknown'
    Host architecture: 'x86_64'
    Precompiled-headers support enabled.
    /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -fvisibility=hidden fvisibility.c
    Symbol visibility control enabled.
    collect2: fatal error: cannot find 'ld'
    compilation terminated.
    /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ --sysroot=/home/tong/raspi/sysroot -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c
    bsymbolic_functions.c:2:2: error: #error "Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129)."
    #error "Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129)."
    ^
    Symbolic function binding disabled.
    checking for C++14...
    /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -marm -mthumb-interwork -mfpu=neon-vfpv4 -mtune=cortex-a7 -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/home/tong/raspi/sysroot -O2 -std=gnu++1y -Wall -W -fPIC -I. -I../../../mkspecs/devices/linux-rasp-pi2-g++ -o c++14.o c++14.cpp
    /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -Wl,-rpath-link,/home/tong/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/tong/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/tong/raspi/sysroot/lib/arm-linux-gnueabihf -mfloat-abi=hard -Wl,-O1 -o c++14 c++14.o --sysroot=/home/tong/raspi/sysroot
    /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory
    /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory
    /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lm
    collect2: error: ld returned 1 exit status
    make: *** [c++14] Error 1
    Makefile:92: recipe for target 'c++14' failed
    C++14 disabled.
    checking for default C++ standard edition...
    /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -pipe -march=armv7-a -marm -mthumb-interwork -mfpu=neon-vfpv4 -mtune=cortex-a7 -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/home/tong/raspi/sysroot -O2 -Wall -W -fPIC -I. -I../../../mkspecs/devices/linux-rasp-pi2-g++ -o c++default.ii -E c++default.cpp
    default C++ standard edition enabled.
    checking for 64-bit std::atomic...
    /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -marm -mthumb-interwork -mfpu=neon-vfpv4 -mtune=cortex-a7 -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/home/tong/raspi/sysroot -O2 -std=gnu++11 -Wall -W -fPIC -I. -I../../../mkspecs/devices/linux-rasp-pi2-g++ -o atomic64.o atomic64.cpp
    In file included from /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.3/arm-linux-gnueabihf/bits/os_defines.h:39:0,
    from /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.3/arm-linux-gnueabihf/bits/c++config.h:430,
    from /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.3/bits/atomic_base.h:35,
    from /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.3/atomic:41,
    from atomic64.cpp:40:
    /home/tong/raspi/sysroot/usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory

    include <sys/cdefs.h>

                         ^
    

    compilation terminated.
    make: *** [atomic64.o] Error 1
    Makefile:198: recipe for target 'atomic64.o' failed
    64-bit std::atomic disabled.
    checking for 64-bit std::atomic in -latomic...
    /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -marm -mthumb-interwork -mfpu=neon-vfpv4 -mtune=cortex-a7 -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/home/tong/raspi/sysroot -O2 -std=gnu++11 -Wall -W -fPIC -I. -I../../../mkspecs/devices/linux-rasp-pi2-g++ -o atomic64.o atomic64.cpp
    In file included from /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.3/arm-linux-gnueabihf/bits/os_defines.h:39:0,
    from /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.3/arm-linux-gnueabihf/bits/c++config.h:430,
    from /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.3/bits/atomic_base.h:35,
    from /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.3/atomic:41,
    from atomic64.cpp:40:
    /home/tong/raspi/sysroot/usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory

    include <sys/cdefs.h>

                         ^
    

    compilation terminated.
    make: *** [atomic64.o] Error 1
    Makefile:198: recipe for target 'atomic64.o' failed
    64-bit std::atomic in -latomic disabled.
    checking for std::atomic for function pointers...
    /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -marm -mthumb-interwork -mfpu=neon-vfpv4 -mtune=cortex-a7 -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/home/tong/raspi/sysroot -O2 -std=gnu++11 -Wall -W -fPIC -I. -I../../../mkspecs/devices/linux-rasp-pi2-g++ -o atomicfptr.o atomicfptr.cpp
    In file included from /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.3/arm-linux-gnueabihf/bits/os_defines.h:39:0,
    from /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.3/arm-linux-gnueabihf/bits/c++config.h:430,
    from /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.3/bits/atomic_base.h:35,
    from /home/tong/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.3/atomic:41,
    from atomicfptr.cpp:34:
    /home/tong/raspi/sysroot/usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory

    include <sys/cdefs.h>

                         ^
    

    compilation terminated.
    make: *** [atomicfptr.o] Error 1
    Makefile:198: recipe for target 'atomicfptr.o' failed
    std::atomic for function pointers disabled.
    ERROR: detected a std::atomic implementation that fails for function pointers.
    Please apply the patch corresponding to your Standard Library vendor, found in
    /home/tong/raspi/qt-everywhere-opensource-src-5.7.1/qtbase/config.tests/common/atomicfptr

    here is feature.h info:
    /* This is here only because every header file already includes this one. */
    #ifndef ASSEMBLER

    ifndef _SYS_CDEFS_H

    include <sys/cdefs.h>

    endif

    my configure:
    ./configure -release -opengl es2 -skip wayland -device linux-rasp-pi2-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v |tee config.out


  • Lifetime Qt Champion

    Do you have a development environment installed on your RPi3 ?



  • @SGaist
    no ,I don't think so.
    1,my rpi3 is clean image download form raspberry, i install some packages needed for my project
    2,i sync the the files to host,
    3,install qt with configuration gcc-linaro-arm-linux-gnueabihf-raspbian-x64.
    4,sync qt files to rpi3,
    5,i find one package is missed, i install the package on rpi3
    6, sync the file to myhost again
    7,i find the problem describe here , i follow your suggestion, in order to reinstall qt i run make unisntall and make clean
    8,configure the qt with arm-rpi-4.9.3-linux-gnueabihf.
    9,error happens
    do you think i should clean my rpi3 and reinstall it?


  • Lifetime Qt Champion

    Take a look at this bug report of the tools repository.



  • @SGaist
    thank you,i will try



  • @SGaist @jsulm
    i successfully run my pro , Thank you very much!


  • Lifetime Qt Champion

    You're welcome !

    Since you have it working now please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)



  • @JiujiuTong said in error: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20':

    ERROR: detected a std::atomic implementation that fails for function pointers.

    hello, I got the same problem as you did

    ERROR: detected a std::atomic implementation that fails for function pointers.

    How did your solve it, please?



  • @huck
    recompile QT with arm-rpi-4.9.3-linux-gnueabihf tool



  • @JiujiuTong said in error: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20':

    ith arm-rpi-4.9.3-linux-gnueabihf tool

    i am not compile qt yet, just in ./configure stage. by the way is arm-rpi-4.9.3-linux-gnueabihf a must?



  • @huck
    do you mean that the error happens when you run ./configure ? can you past the error information ?



  • @JiujiuTong yes , in configure run. and I am using imx6, instead of raspberry

    Proprietary Codecs ..................... no
    Spellchecker ........................... yes
    ALSA ................................... no
    PulseAudio ............................. no

    Note: QtSerialBus: Cannot find linux/can.h and linux/can/raw.h Linux headers for socketCAN support.

    Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.

    WARNING: No QPA platform plugin enabled! This will
    produce a Qt that cannot run GUI applications.
    The dependencies needed for xcb to build are listed in
    src/plugins/platforms/xcb/README

    ERROR: detected a std::atomic implementation that fails for function pointers.
    Please apply the patch corresponding to your Standard Library vendor, found in
    qtbase/config.tests/common/atomicfptr



  • @huck
    sorry, it's not the same phenomenon...
    @SGaist @jsulm
    we need your helps :)



  • @JiujiuTong VC 10 VC 11 GCC 4.6 GCC 4.7 替代方案
    Reworded sequence points No No No No
    Atomics No Yes No Yes Boost.Atomic

    I think my gcc does not supoort “std::atomic”

    thank you all the same


  • Moderators

    @huck You should execute configure with -v and post the actual compiler error.
    What is you GCC version?



  • @jsulm said in error: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20':

    uld execute configure with -v and post the actu

    I did add -v in ./configure . I didn't make it yet, so this is the whole info
    my gcc 4.6.2



  • @SGaist
    another question:
    do you think the tools list below can be used for raspberry pi3?
    https://releases.linaro.org/components/toolchain/binaries/5.4-2017.01/arm-linux-gnueabihf/
    for example gcc-linaro-5.4.1-2017.01-x86_64_arm-linux-gnueabihf.tar.xz seems like a new tool.


  • Lifetime Qt Champion

    @huck likely too old

    @JiujiuTong you can give it try.


Log in to reply
 

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