免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 16581 | 回复: 8
打印 上一主题 下一主题

[Linux] 应用程序编译错误。configure: error: C compiler cannot create executables [问题点 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-07-05 12:32 |只看该作者 |倒序浏览
如何解决如下问题?谢谢。

(1).errors when make
$ make target=ARM | tee build.txt

TARGET: ARM

CRASH: 7.0.7

   GDB: 7.6


checking build system type... x86_64-unknown-linux-gnu

checking host system type... x86_64-unknown-linux-gnu

checking target system type... arm-elf-linux-gnu

checking for a BSD-compatible install... /usr/bin/install -c

checking whether ln works... yes

checking whether ln -s works... yes

checking for a sed that does not truncate output... /bin/sed

checking for gawk... gawk

checking for gcc... gcc

checking for C compiler default output file name...

configure: error: in `/disk_ext/projects/tools/crash/gdb-7.6':

configure: error: C compiler cannot create executables

See `config.log' for more details.

make[2]: *** No targets specified and no makefile found.  Stop.


crash build failed


make[1]: *** [gdb_merge] Error 1

make: *** [all] Error 2

(2). errors in config.log
81 gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
82 configure:4212: $? = 0
83 configure:4201: gcc -V >&5
84 gcc: error: unrecognized option '-V'
85 gcc: fatal error: no input files
86 compilation terminated.
87 configure:4212: $? = 4
88 configure:4201: gcc -qversion >&5
89 gcc: error: unrecognized option '-qversion'
90 gcc: fatal error: no input files
91 compilation terminated.
92 configure:4212: $? = 4
93 configure:4232: checking for C compiler default output file name
94 configure:4254: gcc -m32   conftest.c  >&5
95 /usr/bin/ld: cannot find crt1.o: No such file or directory
96 /usr/bin/ld: cannot find crti.o: No such file or directory
97 /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc.a when searching for -lgcc
98 /usr/bin/ld: cannot find -lgcc
99 /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc_s.so when searching for -lgcc_s
100 /usr/bin/ld: cannot find -lgcc_s
101 /usr/bin/ld: cannot find -lc
102 /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc.a when searching for -lgcc
103 /usr/bin/ld: cannot find -lgcc
104 /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc_s.so when searching for -lgcc_s
105 /usr/bin/ld: cannot find -lgcc_s
106 /usr/bin/ld: cannot find crtn.o: No such file or directory
107 collect2: ld returned 1 exit status
108 configure:4258: $? = 1

(3).更多的config.log内容
1 This file contains any messages produced by compilers while
  2 running configure, to aid debugging if configure makes a mistake.
  3
  4 It was created by configure, which was
  5 generated by GNU Autoconf 2.64.  Invocation command line was
  6
  7   $ ./configure --target=arm-elf-linux CFLAGS=-m32 --with-separate-debug-dir=/usr/lib/debug --with-bugurl= --with-expat=no --with-python=no
  8
  9 ## --------- ##
10 ## Platform. ##
11 ## --------- ##
12
13 hostname = wangxd530u64
14 uname -m = x86_64
15 uname -r = 3.5.0-52-generic
16 uname -s = Linux
17 uname -v = #78~precise1-Ubuntu SMP Wed Jun 11 17:14:53 UTC 2014
18
19 /usr/bin/uname -p = unknown
20 /bin/uname -X     = unknown
21
22 /bin/arch              = unknown
23 /usr/bin/arch -k       = unknown
24 /usr/convex/getsysinfo = unknown
25 /usr/bin/hostinfo      = unknown
26 /bin/machine           = unknown
27 /usr/bin/oslevel       = unknown
28 /bin/universe          = unknown
29
30 PATH: /home/wangxd/bin
31 PATH: /home/wangxd/bin
32 PATH: /usr/lib/lightdm/lightdm
33 PATH: /usr/local/sbin
34 PATH: /usr/local/bin
35 PATH: /usr/sbin
36 PATH: /usr/bin
37 PATH: /sbin
38 PATH: /bin
39 PATH: /usr/games
40
41
42 ## ----------- ##
43 ## Core tests. ##
44 ## ----------- ##
45
46 configure:2317: checking build system type
47 configure:2331: result: x86_64-unknown-linux-gnu
48 configure:2378: checking host system type
49 configure:2391: result: x86_64-unknown-linux-gnu
50 configure:2411: checking target system type
51 configure:2424: result: arm-elf-linux-gnu
52 configure:2478: checking for a BSD-compatible install
53 configure:2546: result: /usr/bin/install -c
54 configure:2557: checking whether ln works
55 configure:2579: result: yes
56 configure:2583: checking whether ln -s works
57 configure:2587: result: yes
58 configure:2594: checking for a sed that does not truncate output
59 configure:2658: result: /bin/sed
60 configure:2667: checking for gawk
61 configure:2683: found /usr/bin/gawk
62 configure:2694: result: gawk
63 configure:3936: checking for gcc
64 configure:3952: found /usr/bin/gcc
65 configure:3963: result: gcc
66 configure:4192: checking for C compiler version
67 configure:4201: gcc --version >&5
68 gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
69 Copyright (C) 2011 Free Software Foundation, Inc.
70 This is free software; see the source for copying conditions.  There is NO
71 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
72
73 configure:4212: $? = 0
74 configure:4201: gcc -v >&5
75 Using built-in specs.
76 COLLECT_GCC=gcc
77 COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
78 Target: x86_64-linux-gnu
79 Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr     --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --    libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --wi    th-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
80 Thread model: posix
81 gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
82 configure:4212: $? = 0
83 configure:4201: gcc -V >&5
84 gcc: error: unrecognized option '-V'
85 gcc: fatal error: no input files
86 compilation terminated.
87 configure:4212: $? = 4
88 configure:4201: gcc -qversion >&5
89 gcc: error: unrecognized option '-qversion'
90 gcc: fatal error: no input files
91 compilation terminated.
92 configure:4212: $? = 4
93 configure:4232: checking for C compiler default output file name
94 configure:4254: gcc -m32   conftest.c  >&5
95 /usr/bin/ld: cannot find crt1.o: No such file or directory
96 /usr/bin/ld: cannot find crti.o: No such file or directory
97 /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc.a when searching for -lgcc
98 /usr/bin/ld: cannot find -lgcc
99 /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc_s.so when searching for -lgcc_s
100 /usr/bin/ld: cannot find -lgcc_s
101 /usr/bin/ld: cannot find -lc
102 /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc.a when searching for -lgcc
103 /usr/bin/ld: cannot find -lgcc
104 /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc_s.so when searching for -lgcc_s
105 /usr/bin/ld: cannot find -lgcc_s
106 /usr/bin/ld: cannot find crtn.o: No such file or directory
107 collect2: ld returned 1 exit status
108 configure:4258: $? = 1
109 configure:4295: result:
110 configure: failed program was:
111 | /* confdefs.h */
112 | #define PACKAGE_NAME ""
113 | #define PACKAGE_TARNAME ""
114 | #define PACKAGE_VERSION ""
115 | #define PACKAGE_STRING ""
116 | #define PACKAGE_BUGREPORT ""
117 | #define PACKAGE_URL ""
118 | /* end confdefs.h.  */
119 |
120 | int
121 | main ()
122 | {
123 |
124 |   ;
125 |   return 0;
126 | }
127 configure:4301: error: in `/disk_ext/projects/tools/crash/gdb-7.6':
128 configure:4305: error: C compiler cannot create executables
129 See `config.log' for more details.
130
131 ## ---------------- ##
132 ## Cache variables. ##
133 ## ---------------- ##
134
135 ac_cv_build=x86_64-unknown-linux-gnu
136 ac_cv_env_AR_FOR_TARGET_set=
137 ac_cv_env_AR_FOR_TARGET_value=
138 ac_cv_env_AR_set=
139 ac_cv_env_AR_value=
140 ac_cv_env_AS_FOR_TARGET_set=
141 ac_cv_env_AS_FOR_TARGET_value=
142 ac_cv_env_AS_set=
143 ac_cv_env_AS_value=
144 ac_cv_env_CCC_set=
145 ac_cv_env_CCC_value=
146 ac_cv_env_CC_FOR_TARGET_set=
147 ac_cv_env_CC_FOR_TARGET_value=
148 ac_cv_env_CC_set=
149 ac_cv_env_CC_value=
150 ac_cv_env_CFLAGS_set=set
151 ac_cv_env_CFLAGS_value=-m32
152 ac_cv_env_CPPFLAGS_set=
153 ac_cv_env_CPPFLAGS_value=
154 ac_cv_env_CXXFLAGS_set=
155 ac_cv_env_CXXFLAGS_value=
156 ac_cv_env_CXX_FOR_TARGET_set=
157 ac_cv_env_CXX_FOR_TARGET_value=
158 ac_cv_env_CXX_set=
159 ac_cv_env_CXX_value=
160 ac_cv_env_DLLTOOL_FOR_TARGET_set=
161 ac_cv_env_DLLTOOL_FOR_TARGET_value=
162 ac_cv_env_DLLTOOL_set=
163 ac_cv_env_DLLTOOL_value=
164 ac_cv_env_GCC_FOR_TARGET_set=
165 ac_cv_env_GCC_FOR_TARGET_value=
166 ac_cv_env_GCJ_FOR_TARGET_set=
167 ac_cv_env_GCJ_FOR_TARGET_value=
168 ac_cv_env_GFORTRAN_FOR_TARGET_set=
169 ac_cv_env_GFORTRAN_FOR_TARGET_value=
170 ac_cv_env_GOC_FOR_TARGET_set=
171 ac_cv_env_GOC_FOR_TARGET_value=
172 ac_cv_env_LDFLAGS_set=
173 ac_cv_env_LDFLAGS_value=
174 ac_cv_env_LD_FOR_TARGET_set=
175 ac_cv_env_LD_FOR_TARGET_value=
176 ac_cv_env_LD_set=
177 ac_cv_env_LD_value=
178 ac_cv_env_LIBS_set=
179 ac_cv_env_LIBS_value=
180 ac_cv_env_LIPO_FOR_TARGET_set=
181 ac_cv_env_LIPO_FOR_TARGET_value=
182 ac_cv_env_LIPO_set=
183 ac_cv_env_LIPO_value=
184 ac_cv_env_NM_FOR_TARGET_set=
185 ac_cv_env_NM_FOR_TARGET_value=
186 ac_cv_env_NM_set=
187 ac_cv_env_NM_value=
188 ac_cv_env_OBJCOPY_set=
189 ac_cv_env_OBJCOPY_value=
190 ac_cv_env_OBJDUMP_FOR_TARGET_set=
191 ac_cv_env_OBJDUMP_FOR_TARGET_value=
192 ac_cv_env_OBJDUMP_set=
193 ac_cv_env_OBJDUMP_value=
194 ac_cv_env_RANLIB_FOR_TARGET_set=
195 ac_cv_env_RANLIB_FOR_TARGET_value=
196 ac_cv_env_RANLIB_set=
197 ac_cv_env_RANLIB_value=
198 ac_cv_env_READELF_FOR_TARGET_set=
199 ac_cv_env_READELF_FOR_TARGET_value=
200 ac_cv_env_READELF_set=
201 ac_cv_env_READELF_value=

论坛徽章:
0
2 [报告]
发表于 2014-07-07 17:04 |只看该作者
更新了gcc编译器,仍不能解决该问题。

论坛徽章:
95
程序设计版块每日发帖之星
日期:2015-09-05 06:20:00程序设计版块每日发帖之星
日期:2015-09-17 06:20:00程序设计版块每日发帖之星
日期:2015-09-18 06:20:002015亚冠之阿尔艾因
日期:2015-09-18 10:35:08月度论坛发贴之星
日期:2015-09-30 22:25:002015亚冠之阿尔沙巴布
日期:2015-10-03 08:57:39程序设计版块每日发帖之星
日期:2015-10-05 06:20:00每日论坛发贴之星
日期:2015-10-05 06:20:002015年亚冠纪念徽章
日期:2015-10-06 10:06:482015亚冠之塔什干棉农
日期:2015-10-19 19:43:35程序设计版块每日发帖之星
日期:2015-10-21 06:20:00每日论坛发贴之星
日期:2015-09-14 06:20:00
3 [报告]
发表于 2014-07-07 20:04 |只看该作者
回复 2# wisedd


    你是想在 x86 平台上编译 ARM 的代码,那么你得有对应得交叉编译工具链,而且得让配置脚本找到它们。

论坛徽章:
0
4 [报告]
发表于 2014-07-07 20:50 |只看该作者
回复 3# MMMIX

我编译的是x86的应用程序,具体的应用程序是crash,运行在x86平台上,用于分析arm linux下的内核panic问题,所以没有交叉编译的问题。


   

论坛徽章:
0
5 [报告]
发表于 2014-07-08 21:51 |只看该作者
git clone https://github.com/crash-utility/crash.git

target=ARM,意为crash目录是的arm.c将会被编译,并不是要用arm-gcc来参与。

论坛徽章:
95
程序设计版块每日发帖之星
日期:2015-09-05 06:20:00程序设计版块每日发帖之星
日期:2015-09-17 06:20:00程序设计版块每日发帖之星
日期:2015-09-18 06:20:002015亚冠之阿尔艾因
日期:2015-09-18 10:35:08月度论坛发贴之星
日期:2015-09-30 22:25:002015亚冠之阿尔沙巴布
日期:2015-10-03 08:57:39程序设计版块每日发帖之星
日期:2015-10-05 06:20:00每日论坛发贴之星
日期:2015-10-05 06:20:002015年亚冠纪念徽章
日期:2015-10-06 10:06:482015亚冠之塔什干棉农
日期:2015-10-19 19:43:35程序设计版块每日发帖之星
日期:2015-10-21 06:20:00每日论坛发贴之星
日期:2015-09-14 06:20:00
6 [报告]
发表于 2014-07-09 23:28 |只看该作者
本帖最后由 MMMIX 于 2014-07-09 23:36 编辑

回复 4# wisedd


    这样啊。仔细看了下你贴的 config.log,你的工具链有问题:
94 configure:4254: gcc -m32   conftest.c  >&5
95 /usr/bin/ld: cannot find crt1.o: No such file or directory
96 /usr/bin/ld: cannot find crti.o: No such file or directory
97 /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc.a when searching for -lgcc
98 /usr/bin/ld: cannot find -lgcc
99 /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc_s.so when searching for -lgcc_s
100 /usr/bin/ld: cannot find -lgcc_s
101 /usr/bin/ld: cannot find -lc
102 /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc.a when searching for -lgcc
103 /usr/bin/ld: cannot find -lgcc
104 /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc_s.so when searching for -lgcc_s
105 /usr/bin/ld: cannot find -lgcc_s
106 /usr/bin/ld: cannot find crtn.o: No such file or directory
107 collect2: ld returned 1 exit status


看起来你是要在 x86_64 环境下编译个 x86 的程序,可是又没有把对应的依赖文件装全(例如说 32位的C库,gcc 依赖库,等)。你这里的 -m32 哪来的?crash 的编译程序自己添加的还是你在配置过程中设置的?

论坛徽章:
0
7 [报告]
发表于 2014-07-15 08:35 |只看该作者
回复 6# MMMIX

分析的有道理。但本人仍没有找到解决方法。
-m32是crash源代码编译时自己添加的,不是我手动添加的。

请再帮忙解决一下。谢谢。

论坛徽章:
95
程序设计版块每日发帖之星
日期:2015-09-05 06:20:00程序设计版块每日发帖之星
日期:2015-09-17 06:20:00程序设计版块每日发帖之星
日期:2015-09-18 06:20:002015亚冠之阿尔艾因
日期:2015-09-18 10:35:08月度论坛发贴之星
日期:2015-09-30 22:25:002015亚冠之阿尔沙巴布
日期:2015-10-03 08:57:39程序设计版块每日发帖之星
日期:2015-10-05 06:20:00每日论坛发贴之星
日期:2015-10-05 06:20:002015年亚冠纪念徽章
日期:2015-10-06 10:06:482015亚冠之塔什干棉农
日期:2015-10-19 19:43:35程序设计版块每日发帖之星
日期:2015-10-21 06:20:00每日论坛发贴之星
日期:2015-09-14 06:20:00
8 [报告]
发表于 2014-07-15 19:57 |只看该作者
回复 7# wisedd


    你要么把缺的包装上,要么把那个 -m32 给去掉。

论坛徽章:
0
9 [报告]
发表于 2014-07-24 00:30 |只看该作者
回复 8# MMMIX

以下方法解决:
sudo apt-get install gcc-multilib


   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP