autoconf抱怨"C编译器无法创建可执行文件".在Linux Mint上 [英] autoconf complains "C compiler cannot create executables" on Linux Mint

查看:116
本文介绍了autoconf抱怨"C编译器无法创建可执行文件".在Linux Mint上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在32位和64位安装上安装Linux Mint 16'petra'.

I am trying to do an installations of Linux Mint 16 'petra' on both 32 and 64 bit installs.

我的电脑上没有互联网连接,因此必须手动安装所有其他软件.作为开发人员,我认为我会尝试使用wxWidgets安装代码块,因此请按照以下说明进行操作:

I have no internet connection on my pc so have to install all additional software manually. Being a developer I thought I would attempt to install codeblocks with wxWidgets so followed the instructions found at:

http://wiki.codeblocks.org/index.php?ti

为了执行安装,我似乎需要先决条件,因此请按照以下说明进行操作 https://developer.gnome.org/gtk3/stable ... lding.html 下载了glib'stuff',解压缩并运行了配置.

In order to perform the installation it appeared that i would need pre-requistites so following instructions found on https://developer.gnome.org/gtk3/stable ... lding.html downloaded glib 'stuff', unpacked and ran configure.

在这一点上,事情失败了.我在终端中收到一条消息,指出C compiler cannot create executablessee config.log for more details包含(以及其他内容)以下内容:

It's at this point that things fail. I get a message in the terminal stating that the C compiler cannot create executables and to see config.log for more details which contains (amongst other stuff) the following:

gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu8) 
configure:4072: $? = 0
configure:4061: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:4072: $? = 4
configure:4061: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.

如何诊断这些错误?

推荐答案

在某些版本的gcc上,-V选项告诉它使用编译器的指定版本-但它需要一个参数.在此处中对此进行了记录.该选项似乎已在4.5.4和4.6.4之间删除了一段时间.

On some versions of gcc, the -V option tells it to use a specified version of the compiler -- but it requires an argument. It's documented here. The option appears to have been removed some time between 4.5.4 and 4.6.4.

但是,预期这样的配置脚本无法执行某些操作,因此它可以确定正在使用的编译器以及支持的功能.在这一点上,脚本似乎并不假定它正在调用的编译器是gcc.相反,它正在尝试许多不同的选项来使编译器报告其自己的版本号.

But a configuration script like this is expected to do things that don't work, so it can determine what compiler it's using and what features it supports. It appears that at this point the script is not assuming that the compiler it's invoking is gcc; rather, it's trying a number of different options to get the compiler to report its own version number.

我认为您向我们显示了错误消息:

I think that the error message you've shown us:

gcc: error: unrecognized command line option '-V'

与您遇到的问题无关.

您需要关注错误消息之前的日志部分,该错误消息指出C编译器无法生成可执行文件".

You need to focus on the portion of the log immediately preceding the error message that says the C compiler "cannot produce executables".

我要尝试的第一件事是编译并执行一个简单的"hello,world"程序.如果这不起作用,则说明您丢失了某些东西,并且您的编译器确实不起作用.如果确实有效,那么您需要研究config.log文件以查看真正导致错误的原因.

The first thing I'd try is to compile and execute a simple "hello, world" program. If that doesn't work, then you're missing something, and your compiler really doesn't work. If it does work, then you need to study the config.log file to see what's really causing the error.

我有时会破解configure脚本来打印更多信息以跟踪此类问题.例如,它将生成并编译一个小的C程序;您可以添加代码以保存该C程序的副本并分别进行检查.

I've sometimes hacked the configure script to print more information to track down problems like this. For example, it will generate and compiler a small C program; you can add code to save a copy of that C program and examine it separately.

这篇关于autoconf抱怨"C编译器无法创建可执行文件".在Linux Mint上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆