Compiling problem on Sol. 8 and gcc

Posted on 2002-06-06
Last Modified: 2013-12-27
I have a Solaris 2.8 machine I inherited.  I installed the F4Sg++-3.0.4-sol8-local.PKG from  It installed fine.  I then tried to use it to compile Gnu's diffutils and got the following:

/opt/progs/diffutils-2.8.1 : # ./configure
checking for a BSD-compatible install... config/install-sh -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets ${MAKE}... yes
checking for gawk... (cached) nawk
checking for gcc... gcc
checking for C compiler default output... configure: error: C compiler cannot create executables

I have tried changing the LD_LIBRARY_PATH but have had no luck.  Can someone help?

--- MIcah
Question by:micahman
  • 2
  • 2
LVL 40

Expert Comment

ID: 7059377
Offhand I'd guess that gcc isn't in your PATH and configure can't find it. I don't know where that package installs gcc, posiibing in /usr/local or in /opt/. If it happened to be in /usr/local adding /usr/local/bin to your path would solve the problem. If it's in /opt you'll add something different.

Author Comment

ID: 7059556
Don't think that's it.  Here's the proof:

/opt/progs/diffutils-2.8.1 : # gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0.4/specs
Configured with: ./configure --prefix=/usr/local
Thread model: posix
gcc version 3.0.4

So it looks like gcc is in the path.
LVL 40

Accepted Solution

jlevie earned 200 total points
ID: 7059813
Okay, I'd agree it's not a PATH problem. Have you checked to see if you can compile a simple program. I've just checked for any problem with the configure script for diffutils working against GCC 3.0.3 and it works fine for me.

Have you verified that your gcc actually works? Try:

chaos> cat > /tmp/gork.c <<EOF
> #include <stdio.h>
> main() { printf("Anybody home?\n"); }
chaos> gcc -o /tmp/gork /tmp/gork.c
chaos> /tmp/gork
Anybody home?

Note that you do have to have the Solaris Bundled Developer support packaes installed to be able to use GCC or any other compiler. So if the test above doesn't work you may not have the utilities, include file, and libs from the Developer support installed.
LVL 38

Expert Comment

ID: 7060902
I am not sure that if you have install all the package/libs
with this version of gcc complier. I have not try version 3.04, but I have tried gcc 3.1 and gcc 2.95.3 in the last few months.

For start, did you use  The GNU make to create your Makefile(not native Solaris make) and check you Makefile to ensure all the correct lib link is defined? (make sure that is link to /usr/local/lib/gcc-lib...).

I told you my story about this gcc compliler. I use gcc (ver 3.1, installed on Sun Blade 1000, Solaris 8), compiling magic7.1 (VLSI design software) no problem. when I use the same complier to compile electric-6.5(another VLSI design software), failed!!!
I end up complied it on another Sun box with gcc 2.95.3 (Solaris 8, Sun Blade 1000) and it works. It looks like the older version of gcc is more stable than the newer one. I have used the old one (gcc 2.95.3) a lot, not much trouble.

May be you should download it (, installed it on a different box, and give it a shot. (please download the glib, libiberty, and GUN version of make, autoconf, automake as well)

Author Comment

ID: 7069636
Sorry this took so long for me to get back to you.  I believe that you are correct.  I spoke to the person who "built" this server and they said that they didn't see the need for the developer tools since this was a server and not a developer machine.  I'm planning on rebuilding the machine correctly anyway.  Thanks again for the help!

--- Micah

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question