C Compiler cannot create executables on Mac

2,947 views
Skip to first unread message

Tristan Slominski

unread,
Nov 6, 2009, 7:06:40 PM11/6/09
to Protocol Buffers
Hey,

I am new to Mac and I can't get the source to compile. When I run ./
configure I get the following error:

checking build system type... i386-apple-darwin10.0.0
checking host system type... i386-apple-darwin10.0.0
checking target system type... i386-apple-darwin10.0.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.

Anyone know how to fix this?

Thanks,

-Tristan

Kenton Varda

unread,
Nov 6, 2009, 7:13:25 PM11/6/09
to Tristan Slominski, Protocol Buffers
What does config.log say?

Tristan Slominski

unread,
Nov 6, 2009, 7:16:35 PM11/6/09
to Protocol Buffers
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by Protocol Buffers configure 2.2.0, which was
generated by GNU Autoconf 2.61. Invocation command line was

$ ./configure

## --------- ##
## Platform. ##
## --------- ##

hostname = Tristan-Slominskis-MacBook-Pro.local
uname -m = i386
uname -r = 10.0.0
uname -s = Darwin
uname -v = Darwin Kernel Version 10.0.0: Fri Jul 31 22:47:34 PDT 2009;
root:xnu-1456.1.25~1/RELEASE_I386

/usr/bin/uname -p = i386
/bin/uname -X = unknown

/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = Mach kernel version:
Darwin Kernel Version 10.0.0: Fri Jul 31 22:47:34 PDT 2009;
root:xnu-1456.1.25~1/RELEASE_I386
Kernel configured for up to 2 processors.
2 processors are physically available.
2 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1
Primary memory available: 4.00 gigabytes
Default processor set: 49 tasks, 245 threads, 2 processors
Load average: 0.23, Mach factor: 1.76
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/bin
PATH: /usr/X11/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2008: checking build system type
configure:2026: result: i386-apple-darwin10.0.0
configure:2048: checking host system type
configure:2063: result: i386-apple-darwin10.0.0
configure:2085: checking target system type
configure:2100: result: i386-apple-darwin10.0.0
configure:2144: checking for a BSD-compatible install
configure:2200: result: /usr/bin/install -c
configure:2211: checking whether build environment is sane
configure:2254: result: yes
configure:2282: checking for a thread-safe mkdir -p
configure:2321: result: ./install-sh -c -d
configure:2334: checking for gawk
configure:2364: result: no
configure:2334: checking for mawk
configure:2364: result: no
configure:2334: checking for nawk
configure:2364: result: no
configure:2334: checking for awk
configure:2350: found /usr/bin/awk
configure:2361: result: awk
configure:2372: checking whether make sets $(MAKE)
configure:2393: result: yes
configure:2649: checking for gcc
configure:2665: found /usr/bin/gcc
configure:2676: result: gcc
configure:2914: checking for C compiler version
configure:2921: gcc --version >&5
i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build
5250)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There
is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

configure:2924: $? = 0
configure:2931: gcc -v >&5
Using built-in specs.
Target: i686-apple-darwin8
Configured with: /private/var/tmp/gcc/gcc-5250.obj~12/src/configure --
disable-checking -enable-werror --prefix=/usr --mandir=/share/man --
enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg]
[^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --
build=powerpc-apple-darwin8 --with-arch=pentium-m --with-tune=prescott
--program-prefix= --host=i686-apple-darwin8 --target=i686-apple-
darwin8
Thread model: posix
gcc version 4.0.1 (Apple Computer, Inc. build 5250)
configure:2934: $? = 0
configure:2941: gcc -V >&5
gcc: argument to `-V' is missing
configure:2944: $? = 1
configure:2967: checking for C compiler default output file name
configure:2994: gcc conftest.c >&5
/usr/bin/ld: /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../
libSystem.dylib unknown flags (type) of section 5
(__TEXT,__dof_magmalloc) in load command 0
collect2: ld returned 1 exit status
configure:2997: $? = 1
configure:3035: result:
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "Protocol Buffers"
| #define PACKAGE_TARNAME "protobuf"
| #define PACKAGE_VERSION "2.2.0"
| #define PACKAGE_STRING "Protocol Buffers 2.2.0"
| #define PACKAGE_BUGREPORT "prot...@googlegroups.com"
| #define PACKAGE "protobuf"
| #define VERSION "2.2.0"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3042: error: C compiler cannot create executables
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=i386-apple-darwin10.0.0
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=i386-apple-darwin10.0.0
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=awk
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_make_make_set=yes
ac_cv_target=i386-apple-darwin10.0.0

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} /Users/seed/Development/tools/protobuf-2.2.0/missing
--run aclocal-1.10'
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='${SHELL} /Users/seed/Development/tools/protobuf-2.2.0/missing --
run tar'
AR=''
AUTOCONF='${SHELL} /Users/seed/Development/tools/protobuf-2.2.0/
missing --run autoconf'
AUTOHEADER='${SHELL} /Users/seed/Development/tools/protobuf-2.2.0/
missing --run autoheader'
AUTOMAKE='${SHELL} /Users/seed/Development/tools/protobuf-2.2.0/
missing --run automake-1.10'
AWK='awk'
CC='gcc'
CCDEPMODE=''
CFLAGS=''
CPPFLAGS=''
CXX=''
CXXCPP=''
CXXDEPMODE=''
CXXFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C='ECHO_N=''
ECHO_T=''
EGREP=''
EXEEXT=''
FGREP=''
GCC_FALSE=''
GCC_TRUE=''
GREP=''
HAVE_ZLIB_FALSE=''
HAVE_ZLIB_TRUE=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
ISAINFO=''
LD=''
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LIPO=''
LN_S=''
LTLIBOBJS=''
MAKEINFO='${SHELL} /Users/seed/Development/tools/protobuf-2.2.0/
missing --run makeinfo'
NM=''
NMEDIT=''
OBJEXT=''
OTOOL64=''
OTOOL=''
PACKAGE='protobuf'
PACKAGE_BUGREPORT='prot...@googlegroups.com'
PACKAGE_NAME='Protocol Buffers'
PACKAGE_STRING='Protocol Buffers 2.2.0'
PACKAGE_TARNAME='protobuf'
PACKAGE_VERSION='2.2.0'
PATH_SEPARATOR=':'
POW_LIB=''
PROTOBUF_OPT_FLAG=''
PROTOC=''
PTHREAD_CC=''
PTHREAD_CFLAGS=''
PTHREAD_LIBS=''
RANLIB=''
SED=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
USE_EXTERNAL_PROTOC_FALSE=''
USE_EXTERNAL_PROTOC_TRUE=''
VERSION='2.2.0'
ac_ct_CC='gcc'
ac_ct_CXX=''
ac_ct_DUMPBIN=''
acx_pthread_config=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__fastdepCXX_FALSE=''
am__fastdepCXX_TRUE=''
am__include=''
am__isrc=''
am__leading_dot='.'
am__quote=''
am__tar='${AMTAR} chof - "$$tardir"'
am__untar='${AMTAR} xf -'
bindir='${exec_prefix}/bin'
build='i386-apple-darwin10.0.0'
build_alias=''
build_cpu='i386'
build_os='darwin10.0.0'
build_vendor='apple'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='i386-apple-darwin10.0.0'
host_alias=''
host_cpu='i386'
host_os='darwin10.0.0'
host_vendor='apple'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='$(SHELL) /Users/seed/Development/tools/protobuf-2.2.0/
install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
lt_ECHO='/bin/echo'
mandir='${datarootdir}/man'
mkdir_p='$(top_builddir)/./install-sh -c -d'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
subdirs=''
sysconfdir='${prefix}/etc'
target='i386-apple-darwin10.0.0'
target_alias=''
target_cpu='i386'
target_os='darwin10.0.0'
target_vendor='apple'

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE_NAME "Protocol Buffers"
#define PACKAGE_TARNAME "protobuf"
#define PACKAGE_VERSION "2.2.0"
#define PACKAGE_STRING "Protocol Buffers 2.2.0"
#define PACKAGE_BUGREPORT "prot...@googlegroups.com"
#define PACKAGE "protobuf"
#define VERSION "2.2.0"

configure: exit 77


On Nov 6, 6:13 pm, Kenton Varda <ken...@google.com> wrote:
> What does config.log say?
>
> On Fri, Nov 6, 2009 at 4:06 PM, Tristan Slominski <
>

Kenton Varda

unread,
Nov 6, 2009, 7:31:04 PM11/6/09
to Tristan Slominski, Protocol Buffers
As the original message suggested, it looks like your compiler doesn't work -- it was unable to compile a no-op program (shown below).  Maybe you need to reinstall it.

Tristan Slominski

unread,
Nov 6, 2009, 7:48:38 PM11/6/09
to Protocol Buffers
Could it be that conftest.c never gets generated? When I look at the
directory... I see conftest.h popup into existence, but never
conftest.c

Tristan Slominski

unread,
Nov 6, 2009, 7:55:18 PM11/6/09
to Protocol Buffers
Looks like I was accidentally downloading some really old Xcode... I'm
updating to the latest version now, I hope that solves the problem.


On Nov 6, 6:48 pm, Tristan Slominski <tristan.slomin...@gmail.com>
wrote:

Kenton Varda

unread,
Nov 6, 2009, 8:36:26 PM11/6/09
to Tristan Slominski, Protocol Buffers
On Fri, Nov 6, 2009 at 4:48 PM, Tristan Slominski <tristan....@gmail.com> wrote:

Could it be that conftest.c never gets generated? When I look at the
directory... I see conftest.h popup into existence, but never
conftest.c

The configure script is generated by autoconf which is used by thousands of open source projects.  So, it's unlikely that it is the problem.

Tristan Slominski

unread,
Nov 7, 2009, 6:33:56 PM11/7/09
to Protocol Buffers
As I indicated above. I got lost on the apple developer site and
downloaded the old Xcode. I updated to the latest one and everything
worked like a charm.

On Nov 6, 7:36 pm, Kenton Varda <ken...@google.com> wrote:
> On Fri, Nov 6, 2009 at 4:48 PM, Tristan Slominski <
>
Reply all
Reply to author
Forward
0 new messages