本周在Ubuntu上交叉编译ARM平台几个开源库open source,耗费了较长时间,其中编译glib遇到了比较难缠的问题,需要记录下来,避免忘记。工具链是平台方提供的现成的。
1、编译glib时,在configure阶段遇到了如下问题:
Checking for msgfmt...no
Checking for gettest...
configure: error:
*** You must have either have gettext support in your C library, or use the
*** GNU gettext library. (gettext - GNU Project - Free Software Foundation)
结论:此时check的是Ubuntu下的gettest库,而非工具链的。由于编译服务器无网络,故没有采用sudo apt-get install安装,而是下载源码编译安装。安装之后错误变成了:
Checking for msgfmt.../usr/local/bin/msgfmt
...
/usr/local/bin/msgfmt: error while loading shared libraries: libgettextsrc-0.21.so: cannot open shared object file: No such file or directory。
这说明检测到了msgfmt但是运行的时候又没有找到libgettextsrc-0.21.so,原来是make install gettext的时候所有的so放在了/usr/local/lib下&#x