0

我从 VMWare 映像中的 64 位PC (AMD64) 桌面映像安装了 Ubuntu 15.04 64 位(我在 win7 64 位下),并尝试在其上构建 gcc 5.2。在配置步骤中,我遇到了一些错误,例如:

/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
collect2: ld returned 1 exit status

我猜它们与 32 位库的明显缺失有关。以同样的方式,使用 ubuntus g++ 和-m32选项编译会导致

/usr/include/c++/4.9/iostream:38:28: fatal error: bits/c++config.h: No such file or directory
#include <bits/c++config.h>

寻找 c++config.h 给了我这个:

/usr/include/x86_64-linux-gnu/c++/4.9/bits/c++config.h

我怀疑 32 个库安装错误,因为我有一个/usr/lib32只有这个的文件夹:

xx@xx-ubuntu1504vm:/usr/lib32$ ls -l
total 1372
drwxr-xr-x 2 root root  12288 août  20 11:00 gconv
lrwxrwxrwx 1 root root     14 mars   6  2015 libform.so.5 -> libform.so.5.9
-rw-r--r-- 1 root root  68012 mars   6  2015 libform.so.5.9
-rw-r--r-- 1 root root 112708 avril 15 04:06 libgcc_s.so.1
lrwxrwxrwx 1 root root     14 mars   6  2015 libmenu.so.5 -> libmenu.so.5.9
-rw-r--r-- 1 root root  34548 mars   6  2015 libmenu.so.5.9
lrwxrwxrwx 1 root root     15 mars   6  2015 libpanel.so.5 -> libpanel.so.5.9
-rw-r--r-- 1 root root  13584 mars   6  2015 libpanel.so.5.9
lrwxrwxrwx 1 root root     19 avril 14 22:15 libstdc++.so.6 ->     libstdc++.so.6.0.20
-rw-r--r-- 1 root root 975360 avril 14 22:51 libstdc++.so.6.0.20
lrwxrwxrwx 1 root root     13 mars   6  2015 libtic.so.5 -> libtic.so.5.9
-rw-r--r-- 1 root root  63160 mars   6  2015 libtic.so.5.9
lrwxrwxrwx 1 root root     13 oct.  27  2014 libz.so.1 -> libz.so.1.2.8
-rw-r--r-- 1 root root 108080 oct.  27  2014 libz.so.1.2.8

在里面。

我能做什么 ?

4

1 回答 1

0

64 位位/c++config.h 文件是通过安装 g++-multilib 包在 32 位系统上提供的(反之亦然),因此您需要使用软件中心、Synaptic 或通过终端使用

sudo apt-get install g++-multilib

这只是一个依赖包,默认 gcc/g++ 版本解析为 g++-4.8-multilib,进而依赖于 lib64stdc++-4.8-dev(32 位上的 64 位编译)或 libx32stdc++-4.8-dev(32 -64 位上的位编译)- 正是这些包含实际的头文件。

普通 C 编译器 gcc 有一组等效的包。

于 2017-02-12T14:38:20.273 回答