我从VMWare映像中的64位PC (AMD64) desktop image安装了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
在其中。
我该怎么办?
答案 0 :(得分:0)
64位/ c ++ config.h文件是通过安装g ++ - multilib软件包在32位系统上提供的(反之亦然),因此您需要使用Software Center,Synaptic安装该软件包,或通过终端使用
sudo apt-get install g++-multilib
这只是一个依赖包,解析为g ++ - 4.8-multilib,用于默认的gcc / g ++版本,而依赖于lib64stdc ++ - 4.8-dev(32位的64位编译)或libx32stdc ++ - 4.8- dev(64位上的32位编译) - 这些包含实际的头文件。
普通的C编译器gcc有一套等价的软件包。