简体   繁体   English

符号查找错误:未定义符号:FT_Get_Font_Format

[英]symbol lookup error: undefined symbol: FT_Get_Font_Format

The error is错误是

linux/FIT/fit: symbol lookup error: linux/FIT/fit: undefined symbol: FT_Get_Font_Format linux/FIT/fit:符号查找错误:linux/FIT/fit:未定义符号:FT_Get_Font_Format

This is part of an Android build.这是 Android 构建的一部分。

It doesn't tell me which .so it searched.它没有告诉我它搜索了哪个.so

I searched for that symbol我寻找那个符号

sudo grep -F "FT_Get_Font_Format" / -r --include="*.so*"

And it's in a bunch of .so files.它在一堆.so文件中。

QUESTION

How do I find out which .so file it's looking for?我如何找出它正在寻找的.so文件?

It doesn't tell me which .so it searched.它没有告诉我它搜索了哪个 .so。

It searched all of the loaded libraries.它搜索了所有加载的库。

Unlike on Windows, the UNIX linker doesn't record which symbol is provided by which library, and the loader searches all currently loaded libraries (in order of their loading) for all of the symbols it needs to resolve.与 Windows 不同,UNIX 链接器不记录哪个库提供了哪个符号,并且加载器搜索所有当前加载的库(按加载顺序)以查找它需要解析的所有符号。

I searched for that symbol sudo grep -F "FT_Get_Font_Format" / -r --include="*.so*"我搜索了那个符号sudo grep -F "FT_Get_Font_Format" / -r --include="*.so*"

That command does not distinguish between definition and references to the symbol, therefore this conclusion:该命令不区分符号的定义和引用,因此得出以下结论:

And it's in a bunch of .so files.它在一堆 .so 文件中。

doesn't tell you anything useful.没有告诉你任何有用的东西。

The correct way to search for definition of the symbol would be:搜索符号定义的正确方法是:

find / -name '*.so*' -type f -print0 |
  xargs -o nm -AD | egrep ' [TDW] FT_Get_Font_Format'

Or you can just google it, and discover that it's part of FreeType API, and should be in libfreetype.so .或者你可以在谷歌上搜索它,发现它是 FreeType API 的一部分,应该在libfreetype.so

This answer suggests that your version of freetype may be too old.这个答案表明您的 freetype 版本可能太旧了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM