cc compiler problem


 
Thread Tools Search this Thread
Operating Systems Solaris cc compiler problem
# 1  
Old 11-18-2009
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?
# 2  
Old 11-28-2009
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.
# 3  
Old 11-29-2009
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)

Code:
> 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:


Code:
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

# 4  
Old 11-29-2009
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.
# 5  
Old 11-29-2009
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:

Code:
"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') : (),
);



Code:
> perl Makefile.PL 
Writing Makefile for MIME::Base64

Code:
> 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

# 6  
Old 11-29-2009
I usually set the CC variable to point to the compiler I want to use, e.g.:
Code:
$ CC=/usr/local/bin/gcc; export CC

Also ensure that /usr/local/lib is on your LD_LIBRARY_PATH.
# 7  
Old 11-29-2009
You might start by replacing -KPIC by -fpic and removing -x03 -xspace and -xildoff options.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

cc compiler and gcc compiler

hi, can we install gcc compiler in unix based OS(sun solar,IBM AIX,HP,etc) and also can we install sun cc compiler in AIX environment and vice versa. and more ..is linux support cc compiler regards Ajay (3 Replies)
Discussion started by: ajaysahoo
3 Replies

2. Solaris

C Compiler

Greetings, :rolleyes: :o :confused: I am working on Solaris 8. I have a few questions: 1. How do I determine if I have the CC compiler? I know it isn't in my $PATH, so how do I find it? 2. How do you install wget? I have read the INSTALL file, but I am not familar with the switches,... (25 Replies)
Discussion started by: Roam
25 Replies

3. Programming

How Can a Machine Reads a Compiler Since A Compiler is Written in Text! Not Binaries?

To make a programming language you need a compiler, so what was the first programming language and how was is created if you need the compiler first? The compiler itself is considered as a high language comparing to the machine! since the compiler is not created in 1's and 0's... Eventhough i... (12 Replies)
Discussion started by: f.ben.isaac
12 Replies

4. UNIX for Dummies Questions & Answers

xl C/C++ compiler to GCC compiler

Hi, we are converting from IBM-AIX(xl c/c++ compiler) to Linux(GCC complier). As a part of this i need to change the CFLAGS. The xl c/c++ complier CFLAGS is CFLAGS := $(CDEBUG) $(PROJECT_INCLUDE_DIRS) $(COBJECT_MODE) -qcpluscmt -qmakedep -qcheck=all \ -qalign=bit_packed $(LINT_FLAGS)... (0 Replies)
Discussion started by: pbattu1
0 Replies

5. Solaris

C compiler

Hello Everyone!!! Can i use the C shell to compile a C program ? how ? please teach me how to compile ? Thanks!!!! Giancarlo D. Jabon (1 Reply)
Discussion started by: giancarlodjabon
1 Replies

6. Programming

C compiler

I'm new to C but eager to get started. I purchasewd beginning C by Ivor Horton and realise that I need a C compiler. I looking for the most appropriate and economical way to obtain this, any suggestions would be greatly appreciated. (5 Replies)
Discussion started by: ferret
5 Replies

7. Programming

c compiler

What can I do if my unix didn't come with cc or gcc. there must be a place to get those programs. Just not where i can find them:confused: (3 Replies)
Discussion started by: hector
3 Replies

8. Programming

Compiler....

:confused: How to do Compiler a .so with oracle9 libs? I have my file -> oracobo.pc my .so is called by Cobol App. -> Runcobol (I don't have source). Which is the statement of cc compiler? It's Right : proc oracobo.pc cc -O -q32 -DDYNAMIC_LIBRARIES_SUPPORTED... (0 Replies)
Discussion started by: luckycs
0 Replies

9. UNIX for Dummies Questions & Answers

C compiler problem

Hi all I just installed FORTE 6 c and c++ compiler after getting the 30 days trial license but after installtion the /opt/SUNWspro/bin/include dir was found empty and there is no header file..when i compile one code it is giving error include header file not found........ please give me any... (1 Reply)
Discussion started by: Prafulla
1 Replies
Login or Register to Ask a Question