Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Sun C code compiled on OSF/1??
@ 1995-07-20  4:00 Andy C. Hsia
  1995-07-20  4:00 ` Mike Iglesias
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andy C. Hsia @ 1995-07-20  4:00 UTC (permalink / raw)



I'm trying to compile C code written for Sun computer on our Alpha 3000/600 
running OSF/1 2.0.  At first, I got a few errors like the following:

/usr/lib/cmplrs/cc/cfe: Error: t3m..c, line 141: redeclaration of 
'random'; previous declaration at line 245 in file '/usr/include/stdlib.h'
 long random();
 -----^
/usr/lib/cmplrs/cc/cfe: Error: t3m..c, line 141: Incompatible 
function return type for this function
 long random();
 -----------^
/usr/lib/cmplrs/cc/cfe: Error: t3m.c, line 145: redeclaration of 
'calloc'; previous declaration at line 145 in file '/usr/include/stdlib.h'
 extern char *calloc();
 -------------^
/usr/lib/cmplrs/cc/cfe: Error: t3m.c, line 145: Incompatible 
function return type for this function
 extern char *calloc();
 -------------------^


So I commented out the offending lines.  The code compiled with no
warnings or errors, but doesn't run properly.  When run, the program
should say, "Starting analysis" and "The volume fraction is..."  My
program, however, just says "Starting analysis," and doesn't go on.  A 'ps
ux' shows that the program is utilizing 99% of the CPU, but no output.  A
colleague successfully compiled (and run) the code on a Sun using ANSI C 
(acc on Sun).  I successfully compiled (and run) the code on Ultrix 4.2 
(using cc -O3 t3m.c -lm).

In light of the recent incident regarding reading README files first, 
etc, let me say that I have read all the documentation that came with the 
code, I've tried many minor modifications to the code, and I'm not an 
experienced cc user.  If I had to guess, I'd say that simply commenting 
out the offending lines caused the variables to be defined as the wrong 
type, therefore doesn't solve my problem.  My question is why doesn't the 
successfully compiled program run properly and what should I look for in 
fixing it?  Thanks

andy



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1995-07-21  4:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-07-20  4:00 Sun C code compiled on OSF/1?? Andy C. Hsia
1995-07-20  4:00 ` Mike Iglesias
1995-07-21  4:00 ` Eric Osborne
1995-07-21  4:00 ` Mark Charette

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox