Autoconf issue: "error: C compiler cannot create executables"

I'm trying to create a program written in C using GNU autotools, but apparently I configured it wrongly because when it configure

works, it spits out:

configure: error: C compiler cannot create executables

      

If I look in config.log

, I see:

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;
| }

      

For some reason autoconf is generating an invalid test file: what should be on this line that appears as a semicolon? Build failure is similar to Ubuntu 9.04 and Mac OS X 10.6, so this is definitely my fault and not the environment.

+2


source to share


4 answers


The problem is that there is a newline in PACKAGE_TARNAME

(s PACKAGE

) that is being set in the file configure.ac

. You have to look at what it contains - fix and rebuild the configure

script.

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)

      

+3


source


It looks like the problem is with the newline character in " ". Check it.jackoff http://github.com/enaeseth/jackoff



+2


source


PACKAGE_TARNAME

does not look correct. First, it has a newline built in, which is the direct cause of your problem.

0


source


You have an additional argument for AC_INIT

the beginning of your configure.ac

. Just remove it.

0


source







All Articles