我正在运行以下命令,其下面是详细输出:
$ clang++ -m32 -I ../include -o format.cc.o -c format.cc -v
clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
Target: i386-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: 32;@m32
"/usr/lib/llvm-6.0/bin/clang" -cc1 -triple i386-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name format.cc -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu pentium4 -dwarf-column-info -debugger-tuning=gdb -v -coverage-notes-file /home/TABLETOPMEDIA/robert/frontend/Core/ThirdParty/fmt/src/format.cc.gcno -resource-dir /usr/lib/llvm-6.0/lib/clang/6.0.0 -I ../include -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++ -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/x86_64-linux-gnu/32 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/backward -internal-isystem /usr/include/clang/6.0.0/include/ -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-6.0/lib/clang/6.0.0/include -internal-externc-isystem /usr/include/i386-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /home/TABLETOPMEDIA/robert/frontend/Core/ThirdParty/fmt/src -ferror-limit 19 -fmessage-length 142 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o format.cc.o -x c++ format.cc
clang -cc1 version 6.0.0 based upon LLVM 6.0.0 default target x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/x86_64-linux-gnu/32"
ignoring nonexistent directory "/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/backward"
ignoring nonexistent directory "/include"
ignoring duplicate directory "/usr/include/clang/6.0.0/include"
#include "..." search starts here:
#include <...> search starts here:
../include
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++
/usr/include/clang/6.0.0/include
/usr/local/include
/usr/include/i386-linux-gnu
/usr/include
End of search list.
In file included from format.cc:8:
In file included from ../include/fmt/format-inl.h:11:
../include/fmt/format.h:31:10: fatal error: 'algorithm' file not found
#include <algorithm>
^~~~~~~~~~~
1 error generated.
我在 Ubuntu 18.04 (64 位) 上使用 32 位库进行编译。我确实有 STL 标头/usr/include/c++/7
,但这似乎不在上面显示的路径中。这是我的 Ubuntu 安装的操作系统问题吗?如果是的话,我可能缺少哪些软件包?
编辑
我已经g++-multilib
安装了:
$ dpkg -l | grep multilib
ii g++-7-multilib 7.3.0-25ubuntu1~18.04 amd64 GNU C++ compiler (multilib support)
ii g++-multilib 4:7.3.0-3ubuntu2 amd64 GNU C++ compiler (multilib files)
ii gcc-7-multilib 7.3.0-25ubuntu1~18.04 amd64 GNU C compiler (multilib support)
ii gcc-8-multilib 8.1.0-10ubuntu1~18.04 amd64 GNU C compiler (multilib support)
ii gcc-multilib 4:7.3.0-3ubuntu2 amd64 GNU C compiler (multilib files)
但是,它只显示已安装amd64
,假设我需要该i386
版本,我尝试安装该版本但失败了:
$ sudo apt install g++-multilib:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
g++-multilib:i386 : Depends: gcc-multilib:i386 (>= 4:7.3.0-3ubuntu2) but it is not going to be installed
Depends: g++:i386 (>= 4:7.3.0-3ubuntu2) but it is not going to be installed
Depends: g++-7-multilib:i386 (>= 7.3.0-12~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
奇怪的是,我安装了一个外部架构dpkg
,我希望i386
能够自动为我安装软件包版本:
$ dpkg --print-foreign-architectures
i386