1825882 Members
2850 Online
109689 Solutions
New Discussion

Compile C

 
SOLVED
Go to solution

Compile C

hi friends:

I have a question for you:

How can i compile a C program in a HPUX11i environment?

I´m novice in this topic, and i need ypur help to resolve this problem.

What is the correct statement?

after compile, what is the next step?

Thanks

Daniel
1 REPLY 1
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Compile C

First, create a c source file, e.g., myfile.c.

------------------------------------------
#include

int main()
{
(void) printf("Hello world.\n");
return(0);
}
------------------------------------------
Next, compile it and link it:
cc myfile.c -o myfile

Next execute it:
myfile

Now the c compiler that comes standard with HP-UX is the Bundled C compiler; it only understands K & R C and is really intended only for building kernels. It can be used for limited development but the product you need is aCC which understands both ANSI C and C++. You can also install the Gnu C compiler for development; it has the virtue of being free.

If it ain't broke, I can fix that.