cc compiler problem

trying to compile a program, first issue was could not find cc

so i added /usr/ucb to my PATH

now I get:

/usr/ucb/cc: language optional software package not installed

anyone have any ideas?

Yes you do not have a C complier installed, suggest you download a free GNU C (GCC) compiler from Sunfreeware - Free and Open Source Software (FOSS) for Sun Microsystem's Solaris and remove /usr/ucb/cc from your path.

I do have the gnu c compiler installed

/usr/local/bin/gcc

but when i try to use that one, and take out the /usr/ucb/ out of my path, it doesnt even find the gnu compiler. (yes, /usr/local/bin is in my path)

> make
cc -c   -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_TS_ERRNO -xO3 -xspace -xildoff   -DVERSION=\"3.01\" -DXS_VERSION=\"3.01\" -KPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE"   Base64.c
/bin/sh: cc: not found
make: *** [Base64.o] Error 1

so then i tried to make a symbolic link that make it look just for "cc"

and then I get:

cc -c   -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_TS_ERRNO -xO3 -xspace -xildoff   -DVERSION=\"3.01\" -DXS_VERSION=\"3.01\" -KPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE"   Base64.c
cc: unrecognized option `-KPIC'
cc: language ildoff not recognized
cc: Base64.c: linker input file unused because linking not done
rm -f blib/arch/auto/MIME/Base64/Base64.so
LD_RUN_PATH="" cc  -G Base64.o  -o blib/arch/auto/MIME/Base64/Base64.so      
cc: Base64.o: No such file or directory
cc: no input files
make: *** [blib/arch/auto/MIME/Base64/Base64.so] Error 1

As it is, your makefile is requiring the Sun Studio C compiler, not the Gnu one. You can download the former freely or adjust the makefile for gcc.

Thanks, I am trying to download/install the Sun Studio package/compiler now, will see if that works.
Will update later.

---------- Post updated at 06:28 AM ---------- Previous update was at 05:14 AM ----------

I seem to be running into a disk space problem for installing the Sun Studio stuff.

In the mean time, how would I do option 2? Adjust the make file to use the GNU compiler?

There is no ./configure, make file is made my a perl script:

"Makefile.PL" 11 lines, 317 characters 
require 5.005;
use ExtUtils::MakeMaker;

WriteMakefile(
    NAME         => 'MIME::Base64',
    VERSION_FROM => 'Base64.pm',
    EXE_FILES    => [qw(encode-base64 decode-base64 encode-qp decode-qp)],
    dist         => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
    ($] >= 5.008) ?
      (INSTALLDIRS => 'perl') : (),
);
> perl Makefile.PL 
Writing Makefile for MIME::Base64
> make
cc -c   -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_TS_ERRNO -xO3 -xspace -xildoff   -DVERSION=\"3.01\" -DXS_VERSION=\"3.01\" -KPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE"   Base64.c
cc: unrecognized option `-KPIC'
cc: language ildoff not recognized
cc: Base64.c: linker input file unused because linking not done
Running Mkbootstrap for MIME::Base64 ()
chmod 644 Base64.bs
rm -f blib/arch/auto/MIME/Base64/Base64.so
LD_RUN_PATH="" cc  -G Base64.o  -o blib/arch/auto/MIME/Base64/Base64.so      
cc: Base64.o: No such file or directory
cc: no input files
make: *** [blib/arch/auto/MIME/Base64/Base64.so] Error 1

I usually set the CC variable to point to the compiler I want to use, e.g.:

$ CC=/usr/local/bin/gcc; export CC

Also ensure that /usr/local/lib is on your LD_LIBRARY_PATH.

You might start by replacing -KPIC by -fpic and removing -x03 -xspace and -xildoff options.

> echo $CC
/usr/local/bin/gcc

> make
cc -c   -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_TS_ERRNO -xO3 -xspace -xildoff   -DVERSION=\"3.01\" -DXS_VERSION=\"3.01\" -KPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE"   Base64.c
/bin/sh: cc: not found
make: *** [Base64.o] Error 1

How would I do this?

By using your favorite text editor and modifying the Makefile(s) containing the unwanted options.

after changes made:

> make
/usr/local/bin/gcc -c   -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_TS_ERRNO    -DVERSION=\"3.01\" -DXS_VERSION=\"3.01\" -fPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE"   Base64.c
gcc: language arch=v8 not recognized
gcc: Base64.c: linker input file unused because linking not done
Running Mkbootstrap for MIME::Base64 ()
chmod 644 Base64.bs
rm -f blib/arch/auto/MIME/Base64/Base64.so
LD_RUN_PATH="" cc  -G Base64.o  -o blib/arch/auto/MIME/Base64/Base64.so      
/sbin/sh: cc: not found
make: *** [blib/arch/auto/MIME/Base64/Base64.so] Error 1

Then remove "-xarch=v8".

What Solaris release are you using ?

> uname -a
SunOS bender 5.10 Generic_120011-14 sun4u sparc SUNW,Ultra-60 Solaris

I think I might have figured it out, I removed the xarch=v8 as well as in the makefile there were multiple references to "cc" which did not seem to be resolving to either my path, nor the path in the makefile, so it had to be changed in multiple areas. I think it worked.

Glad you make it. As you are using Solaris 10 which includes gcc in /usr/sfw/bin/gcc, any specific reason why you use instead /usr/local/bin/gcc ?

Didn't really think it mattered, when I used the included I was receiving the same errors:

/usr/sfw/bin/gcc -c   -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_TS_ERRNO -xO3 -xspace -xildoff   -DVERSION=\"1.2\" -DXS_VERSION=\"1.2\" -KPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE"   Iconv.c
gcc: unrecognized option `-KPIC'
gcc: language ildoff not recognized

Yes, that wouldn't have improved the issue. I was just curious.
It seems to me a large number of Solaris 10 users are missing that many freeware are installed in /usr/sfw/bin. The main reason is that directory in unfortunately not included in the default PATH.