how to fix "arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `clock_gettime@GLIBC_2.17'?

kipade kipade@163.com
Tue Mar 10 14:35:46 GMT 2020


And I checked the libstdc++.so, and really found the clock_gettime@GLIBC_2.17' reference call
with it. If so, was there a method to generate a smart method to fix that, for example, implement
my own function and exported it with the named symbol as clock_gettime@GLIBC_2.17 ?

At 2020-03-10 22:24:22, "Florian Weimer" <fw@deneb.enyo.de> wrote:
>* kipade:
>
>>>> "/opt/arm-toolchain/linux/linaro/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../.
>>>> ./arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `clock_gettime@GLIBC_2.17'
>
>> thanks for your reply. my link cmd is:
>> arm-linux-gnueabihf-g++ main.o -L ../arm_common/build/lib/ -larmcomm -pthread -lelf  -ldl -lrt
>
>This doesn't look particularly suspicious.
>
>You need to double-check that your cross-compiler version matches the
>glibc version you have installed for its use.  The error message
>suggests that you are using an outdated glibc version that predates
>the one that was used to build GCC and libstdc++.  (It's also possible
>that you are not trying to link against glibc at all, but in that
>case, more undefined symbols would show up, I think.)
>
>(I assume this is a cross-compilation environment, so there's no risk
>that there are Arm libraries on the host.)


More information about the Gcc-help mailing list