Autoconf的问题:“错误:C编译器不能创建可执行文件” [英] Autoconf problem: “error: C compiler cannot create executables”
问题描述
我试图建立我已经使用GNU自动工具用C语言编写的程序,但我显然有它设置错了,因为当配置
运行时,它吐出来
I'm trying to build a program I've written in C using GNU autotools, but I evidently have it set up wrong because when configure
runs, it spits out:
configure: error: C compiler cannot create executables
如果我在看的config.log
,我看到:
configure:2846: checking for C compiler default output file name
configure:2868: gcc conftest.c >&5
conftest.c:3:25: warning: missing terminating " character
conftest.c:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "Jackoff"
| #define PACKAGE_TARNAME "jackoff
| http://github.com/enaeseth/jackoff"
| #define PACKAGE_VERSION "0.1"
| #define PACKAGE_STRING "Jackoff 0.1"
| #define PACKAGE_BUGREPORT "Eric Naeseth <enaeseth@gmail.com>"
| #define PACKAGE "jackoff
| http://github.com/enaeseth/jackoff"
| #define VERSION "0.1"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
由于某些原因,Autoconf是一个生成一个无效的测试文件:应该是在该行快到了作为只是一个分号什么?构建在Ubuntu的9.04和Mac OS X 10.6以同样的方式失败了,所以这绝对是我的错,不是环境的。
For some reason, autoconf is generating an invalid test file: what should be on that line that is coming up as just an semicolon? The build fails in the same way on Ubuntu 9.04 and Mac OS X 10.6, so this is definitely my fault, not the environment's.
推荐答案
麻烦的是,有一个在 PACKAGE_TARNAME
(和 PACKAGE换行符
),这是在 configure.ac
文件中设置。你应该看一下它包含 - 修复它,并重新生成配置
剧本
The trouble is that there is a newline in the PACKAGE_TARNAME
(and PACKAGE
), which is set in the configure.ac
file. You should look at what that contains - fix it, and regenerate the configure
script.
我的一个configure.ac脚本包含(靠近顶部):
One of my configure.ac scripts contains (near the top):
AC_CONFIG_HEADER(config.h)
PACKAGE="sqlcmd"
VERSION="86.04"
AC_MSG_RESULT([Configuring $PACKAGE version $VERSION])
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
这篇关于Autoconf的问题:“错误:C编译器不能创建可执行文件”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!