"checking for C compiler default output... configure: error: C compiler cannot create executables"

Here are some general troubleshooting steps for this error message:

1. Have you installed a compiler on your Solaris system? Solaris does not come with a compiler. The open source gcc compiler from Sunfreeware is an excellent choice.

2. Did you perform a "core" Solaris install, or a "full" install? The "core" installation may not include all the packages needed to support a compiler. See section 6.2 of the Solaris 2 FAQ below.

3. If you have a compiler such as gcc installed, and have confirmed that you have the necessary packages to support the compiler, make sure that gcc is in your PATH environment variable before cc.

which cc gcc
echo $PATH

Is gcc before cc in your PATH?

4. Even if gcc is before cc in your PATH, you may have to specify CC=gcc when compiling applications.

CC=gcc ./configure

CC=gcc; export CC; ./configure

More information

From http://www.faqs.org/faqs/Solaris2/FAQ/:

6.2) Which packages do I need to install to support a C compiler?

Solaris ships with everything you need, with the exception of the compiler itself. Solaris ships with the include files, make, an assembler, linker and libraries. All this stuff lives in /usr/ccs/bin (add it to your PATH before /usr/ucb if that's in your PATH as well) /usr/ccs/lib and /usr/include.

If you still can't find it, make sure you have the following packages installed on your system:

for tools (sccs, lex, yacc, make, nm, truss, ld, as):
SUNWbtool, SUNWsprot, SUNWtoo
for libraries & headers:
SUNWhea, SUNWarc, SUNWlibm, SUNWlibms
SUNWdfbh, SUNWcg6h, SUNWxwinc, SUNWolinc,
for 64 bit development:
SUNWarcx, SUNWbtoox, SUNWdplx, SUNWscpux, SUNWsprox,
SUNWtoox, SUNWlmsx, SUNWlmx, SUNWlibCx
for ucb compat:
SUNWsra, SUNWsrh


If you have these packages installed, check the config.log output see exactly where the configure script failed.

If you are running Solaris 2.6, here are the packages (and numbers if you run a pkgadd -d /cdrom/sol_2_6_sparc_smcc_svr/s0/Solaris_2.6/Product command to list all packages on the CD):

SUNWarc 29
SUNWbtool 38
SUNWcg6h 47
SUNWdfbh 58
SUNWhea 106
SUNWlibm 150
SUNWlibms 151
SUNWolinc 179
SUNWsprot 230
SUNWsra 231
SUNWsrh 233
SUNWtoo 251
SUNWxglh 265
SUNWxwinc 287


If you install the packages above on a system that already has the latest patch cluster, you may encounter problems when running Solaris' linker:

ld: fatal: ld.so.1: /usr/ccs/bin/ld: fatal: relocation error: file /usr/ccs/lib/libld.so.2: symbol dbg_mask: referenced symbol not found

Reinstalling the patch cluster may fix the problem. Using the GNU linker contained in the Sunfreeware binutils package will also fix the problem.

Back to brandonhutchinson.com.

Last modified: 07/09/2003