C编译器在交叉编译时无法创建可执行文件

时间:2021-04-27 15:14:45

标签: c++ c linux gcc

我正在 Windows 10 下的基于 Intel 的 Linux Ubuntu 系统上为 QNX 6.5.0 下的 Intel i486 进行交叉编译。其中一个库是 snappy,v.1.0.4。将 i486-pc-nto-qnx6.5.0* 工具(gcc、g++、ld 等)从 QNX 系统复制到 Ubuntu 中的 /usr/local/bin。然后配置为./configure --build=x86_64-pc-linux-gnu --host=i486-pc-nto-qnx6.5.0。运行make,报错:C compiler can't create executables when cross-compiles.

在 config.log 中:

configure:2985: checking whether make sets $(MAKE)
configure:3007: result: yes
configure:3117: checking build system type
configure:3131: result: x86_64-pc-linux-gnu
configure:3151: checking host system type
configure:3164: result: i486-pc-nto-qnx6.5.0
configure:3196: checking for style of include used by make
configure:3224: result: GNU
configure:3254: checking for i486-pc-nto-qnx6.5.0-gcc
configure:3270: found /usr/local/bin/i486-pc-nto-qnx6.5.0-gcc
configure:3281: result: i486-pc-nto-qnx6.5.0-gcc
configure:3550: checking for C compiler version
configure:3559: i486-pc-nto-qnx6.5.0-gcc --version >&5
configure:3572: $? = 1
configure:3592: checking whether the C compiler works
configure:3614: i486-pc-nto-qnx6.5.0-gcc    conftest.c  >&5
configure:3618: $? = 1
configure:3656: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "snappy"
| #define PACKAGE_TARNAME "snappy"
| #define PACKAGE_VERSION "1.0.4"
| #define PACKAGE_STRING "snappy 1.0.4"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define PACKAGE "snappy"
| #define VERSION "1.0.4"
| /* end confdefs.h.  */
|
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3661: error: in `/home/kirill/eleveldb/c_src/snappy-1.0.4':
configure:3665: error: C compiler cannot create executables
See `config.log' for more details.

0 个答案:

没有答案