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

查看:42
本文介绍了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 '东西',解压并运行配置.

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 编译器无法创建可执行文件查看 config.log 了解更多详细信息,其中包含(除其他外)以下内容:>

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天全站免登陆