Ubuntu 编译 FileZilla Server 时报错,错误信息是 ‘class wxFont’ has no member named ‘GetBaseFont’。- mounttableeditor.cpp: In member function ‘bool MountTableEditor::Create(wxWindow*, wxWindowID, const wxPoint&, const wxSize&, long int, const wxString&)’:
- mounttableeditor.cpp:158:41: error: ‘class wxFont’ has no member named ‘GetBaseFont’
- 158 | h->SetFont(h->GetFont().GetBaseFont());
- | ^~~~~~~~~~~
复制代码 导致编译失败
- ...
- mounttableeditor.cpp: In member function ‘bool MountTableEditor::Create(wxWindow*, wxWindowID, const wxPoint&, const wxSize&, long int, const wxString&)’:
- mounttableeditor.cpp:158:41: error: ‘class wxFont’ has no member named ‘GetBaseFont’
- 158 | h->SetFont(h->GetFont().GetBaseFont());
- | ^~~~~~~~~~~
- make[3]: *** [Makefile:1080: filezilla_server_gui-mounttableeditor.o] Error 1
- make[3]: Leaving directory '/home/wuxiancheng/filezilla-server-1.8.2/src/gui'
- make[2]: *** [Makefile:426: all-recursive] Error 1
- make[2]: Leaving directory '/home/wuxiancheng/filezilla-server-1.8.2/src'
- make[1]: *** [Makefile:365: all] Error 2
- make[1]: Leaving directory '/home/wuxiancheng/filezilla-server-1.8.2/src'
- make: *** [Makefile:459: all-recursive] Error 1
复制代码 首先,这个错误是 wxWidgets 的 wxFont::GetBaseFont() 触发的,其次,wxFont::GetBaseFont() 是在 wxWidgets 3.1.0 中引入的,如果 wxWidgets 版本低于 3.1.0,wxFont 没有 GetBaseFont(),会触发 ‘class wxFont’ has no member named ‘GetBaseFont’ 这个错误。Filezilla Server 的 configure 脚本在检查依赖时只要满足 wxWidgets 3.0.4+ 就可以通过检测,但编译中途会出错。- wxFont wxFont::GetBaseFont() const
- Returns a font with the same face/size as the given one but with normal weight and style and not underlined nor stricken through.
- Since
- 3.1.0
复制代码 将 wxWidgets 升级到 3.1.0 或更高版本可以解决这个问题。
Ubuntu 22.04 上 wxWidgets (libwxgtk3.0-gtk3-dev)的版本号是Ubuntu 22.04 不提供更高版本的 wxWidgets,可以到 wxWidgets 官方下载载源码自行编译,编译安装高版本的 wxWidgets 以后再次编译 FileZilla Server 就不会报 ‘class wxFont’ has no member named ‘GetBaseFont’ 这个错误了。
相关链接 wxWidgets wxFont::GetBaseFont() FileZilla Server |
|