在使用他人提供的ffmpeg动态库时,发生编译错误。
undefined reference to ‘powf@GLIBC_2.27’
参考这篇文章: https://answers.ros.org/question/327482/libflycaptureso-undefined-reference-to-powfglibc_227/
问题原因:
编译ffmpeg动态库的编译环境是Ubuntu 18.04: glibc版本是2.27
本地编译环境是Ubuntu 14.04: glibc版本是2.19;
powf函数在glibc 2.19中没有找到,所以编译失败。
ubuntu查看glibc版本:
ldd --version
root@ubuntu:/usr# ldd --version
ldd (Ubuntu EGLIBC 2.19-0ubuntu6.15) 2.19
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
解决方法:
方法一: 本地使用glibc 2.19 重新编译动态库;
方法二: 本地的glibc换成2.27