0

I use catkin_make to compile a ros project, but it failed. it shows that there are some problems when linking the library.

[ 98%] Linking CXX executable /home/kyxz2021/fleet/devel/lib/data_parser/data_parser_node
/lib/x86_64-linux-gnu/libm.so.6: undefined reference to `__strtof128_nan@GLIBC_PRIVATE'
collect2: error: ld returned 1 exit status

i searched the error, someone said it might due to the inconsistency between libm version and libc version, but it is not the knot here.

***@ubuntu:~$ ll /lib/x86_64-linux-gnu/libm.so.6
lrwxrwxrwx 1 root root 12 May 16 20:52 /lib/x86_64-linux-gnu/libm.so.6 -> libm-2.23.so
***@ubuntu:~$ ll /lib/x86_64-linux-gnu/libc*
-rwxr-xr-x 1 root root 1868984 Jun  5  2020 /lib/x86_64-linux-gnu/libc-2.23.so*
lrwxrwxrwx 1 root root      14 Feb 11  2016 /lib/x86_64-linux-gnu/libcap.so.2 -> libcap.so.2.24
-rw-r--r-- 1 root root   23128 Oct 23  2015 /lib/x86_64-linux-gnu/libcap.so.2.24
lrwxrwxrwx 1 root root      21 Feb 11  2016 /lib/x86_64-linux-gnu/libcgmanager.so.0 -> libcgmanager.so.0.0.0
-rw-r--r-- 1 root root  141248 Jan 18  2016 /lib/x86_64-linux-gnu/libcgmanager.so.0.0.0
-rw-r--r-- 1 root root  190856 Jun  5  2020 /lib/x86_64-linux-gnu/libcidn-2.23.so
lrwxrwxrwx 1 root root      15 Jun  5  2020 /lib/x86_64-linux-gnu/libcidn.so.1 -> libcidn-2.23.so
lrwxrwxrwx 1 root root      17 Jan 22  2020 /lib/x86_64-linux-gnu/libcom_err.so.2 -> libcom_err.so.2.1
-rw-r--r-- 1 root root   14648 Jan 22  2020 /lib/x86_64-linux-gnu/libcom_err.so.2.1
-rw-r--r-- 1 root root   39224 Jun  5  2020 /lib/x86_64-linux-gnu/libcrypt-2.23.so
-rw-r--r-- 1 root root 2366112 Feb 17 10:21 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
lrwxrwxrwx 1 root root      22 Feb 11  2016 /lib/x86_64-linux-gnu/libcryptsetup.so.4 -> libcryptsetup.so.4.6.0
-rw-r--r-- 1 root root  158920 Sep  6  2017 /lib/x86_64-linux-gnu/libcryptsetup.so.4.6.0
lrwxrwxrwx 1 root root      16 Jun  5  2020 /lib/x86_64-linux-gnu/libcrypt.so.1 -> libcrypt-2.23.so
lrwxrwxrwx 1 root root      12 Jun  5  2020 /lib/x86_64-linux-gnu/libc.so.6 -> libc-2.23.so*

And the output of nm -AD /lib/x86_64-linux-gnu/lib{c,m}-2.23.so | grep __strtof128_nan is shown below.

***@ubuntu:~$ nm -AD /lib/x86_64-linux-gnu/lib{c,m}-2.23.so | grep __strtof128_nan
/lib/x86_64-linux-gnu/libm-2.23.so:                 U __strtof128_nan

i don't know how to solve the problem, i'd be appreciated if someone could help me.

冯江仑
  • 1
  • 1
  • Please don't show _images_ of text. Cut/paste text into your question directly instead. – Employed Russian Jul 22 '21 at 23:34
  • The definition of `__strtof128_nan@GLIBC_PRIVATE` should be in `libc-2.23.so`. Please edit your question and add the output from `nm -AD /lib/x86_64-linux-gnu/lib{c,m}-2.23.so | grep __strtof128_nan` ? – Employed Russian Jul 22 '21 at 23:50

1 Answers1

-1

This particular error seems to be from not having float128 support (aka quadmath). Check that your gcc version and libraries are new enough and have the right links. Since it's not a compile but linking error, perhaps you need to link against -lquadmath. But also, since your error msg seems to show the compilation target as custom code, do you need to be using quadmath?

JWCS
  • 1,120
  • 1
  • 7
  • 17