我正在交叉编译一个Lazarus程序,在64位Ubuntu 14.04 Trusty Tahr系统上创建一个32位程序,当我得到这个消息时,一切都显然编译到最后
/usr/bin/ld: cannot find -lglib-2.0
缺少导致此错误信息的库的全名是什么?
libc6-dev:i386
似乎是最有可能的库,但是当我尝试使用apt指示build-essential g++ gcc gcc-multilib
进行安装时,它将被删除,因此我将其中止。
sudo apt-get install libc6-dev:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
linux-libc-dev linux-libc-dev:i386
Suggested packages:
glibc-doc:i386 manpages-dev:i386
Recommended packages:
gcc:i386 c-compiler:i386
The following packages will be REMOVED
build-essential g++ gcc gcc-multilib
The following NEW packages will be installed
libc6-dev:i386 linux-libc-dev:i386
The following packages will be upgraded:
linux-libc-dev
1 to upgrade, 2 to newly install, 4 to remove and 18 not to upgrade.
Need to get 3,126 kB of archives.
After this operation, 12.6 MB of additional disk space will be used.
Do you want to continue? [Y/n]
答案 0 :(得分:0)
事实证明这是libglib2.0-0:i386
包。它之前已经安装过,但尚未完全配置。
它存在于/lib/i386-linux
目录中,我必须创建一个符号链接,将其包含在Free Pascal使用的fpc.cfg
配置文件中。
locate libglib | grep ^/lib
制作了:
/lib/i386-linux-gnu/libglib-2.0.so.0
/lib/i386-linux-gnu/libglib-2.0.so.0.4002.0
/lib/x86_64-linux-gnu/libglib-2.0.so.0
/lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0
我用预期的名称对其进行符号链接:
ln -s /lib/i386-linux-gnu/libglib-2.0.so.0 /lib/i386-linux-gnu/libglib-2.0.so
然后添加到Lazarus安装fpc.cfg
文件
#ifdef cpui386
-Fl/usr/lib32
-Fl/lib/i386-linux-gnu
#endif