在 Eclipse 中创建新的 C++ 项目时,有人问我工具链。
这些工具链Cross GCC和Linux GCC. 在什么情况下使用它们?和项目是否要在linux和windows机器上编译有关系吗?
在其中一个答案中,我们可以阅读:
通常,交叉编译器是为与您的系统不同类型的系统生成代码的编译器。
所以如果我使用自己的 makefile 在目标机器上编译项目,我在这里选择什么选项都没有关系,对吗?
这在某种程度上是 gentoo 特定的,所以我将在那个上下文中解释它,然后尝试将它抽象为一个通用的 linux 机器。
当我的机器是Athlon64时,我一开始不小心将我的CHOST设置为“i686-pc-linux-gnu”,没有注意。我想将其更改为“x86_64-pc-linux-gnu”。 有一个指南。 它不起作用。
第一步是“重新编译binutils,然后重新编译gcc”
这是说明的问题:
所以我尝试了以下方法:
gcc 编译失败:
/usr/x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
/usr/x86_64-pc-linux-gnu/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)
这是一个 glibc 错误(完成链)。
所以它看起来:
我刚刚了解了 Gentoo 的sys-devel/crossdev包。这是一个可用于创建交叉编译工具链的包。
其他发行版上是否还有其他此类软件包?
我对发行版维护的软件包特别感兴趣,因为我已经尝试了其他几个(buildroot,crosstool),而且似乎只要发行版涉及 gcc 或 binutils,它总是至少会破坏工具链的构建,如果没有的话项目本身的建设。
我正在尝试运行 arm linux gcc(linaro 2013 工具链)并收到以下错误:
arm-linux-gnueabihf-gcc: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
Run Code Online (Sandbox Code Playgroud)
它在 64 位操作系统上构建 32 位。我正在运行 Ubuntu Precise。
我正在遵循本指南:https : //wiki.archlinux.org/index.php/Orange_Pi
我在此命令上遇到错误:$ make -j4 ARCH=arm CROSS_COMPILE=arm-none-eabi-
这是错误:
make: arm-none-eabi-gcc: Command not found
/bin/sh: 1: arm-none-eabi-gcc: not found
dirname: missing operand
Try 'dirname --help' for more information.
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config.h
  UPD     include/config.h
  CFG     u-boot.cfg
/bin/sh: 1: arm-none-eabi-gcc: not found
  GEN     include/autoconf.mk.dep
/bin/sh: 1: arm-none-eabi-gcc: not found
scripts/Makefile.autoconf:79: recipe for target 'u-boot.cfg' failed
make[1]: *** [u-boot.cfg] Error 1
make[1]: *** Waiting for unfinished jobs....
scripts/Makefile.autoconf:50: recipe for target 'include/autoconf.mk.dep' failed
  CFG     spl/u-boot.cfg
make[1]: *** [include/autoconf.mk.dep] Error …Run Code Online (Sandbox Code Playgroud)