Solved

Compiling problem on Sol. 8 and gcc

Posted on 2002-06-06
5
415 Views
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 Freeware4sun.com.  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
0
Comment
Question by:micahman
  • 2
  • 2
5 Comments
 
LVL 40

Expert Comment

by:jlevie
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.
0
 

Author Comment

by:micahman
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.
0
 
LVL 40

Accepted Solution

by:
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"); }
> EOF
chaos> gcc -o /tmp/gork /tmp/gork.c
chaos> /tmp/gork
Anybody home?
chaos>

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.
0
 
LVL 38

Expert Comment

by:yuzh
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 (http://sunfreeware.com/), 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)
0
 

Author Comment

by:micahman
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
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

828 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