Link to home
Start Free TrialLog in
Avatar of jfz2004
jfz2004

asked on

Compiling a sample c file takes forever on unix

Hi,

I have a sample c file - test.c and I am compiling it on unix
and it is take forever and still working on it to just compile.

The command I typed in is:

% cc test.c

and the compiler I use is: /vol/opt/SUNWspro.new/bin/cc
and the file is:

main()
   {
      float   x, y, z, sum, avg;
                           
      printf("Please enter 3 numbers: ");
      scanf("%f %f %f", &x, &y, &z);
      sum = x + y + z;
      avg = sum / 3.0;
      printf("The average of the three numbers is: %f\n",avg);
    }

Why isn't it just compile and give me a.out?

Thanks,

Also any good and free c compiler on Windows 2000/XP?

Jennifer

Avatar of jfz2004
jfz2004

ASKER

Now I know what the problem is:

License Error : Cannot connect to the license server (lserv2)..
        for product(Sun WorkShop Compiler C).
        (License server may not have been started)
Cannot connect to license server (-15,12:145) Connection timed out
cc: acomp failed for test.c
SOLUTION
Avatar of wayside
wayside

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jfz2004

ASKER

I searched for gcc but it seems to be a unix compiler.
Although it has something called DJGPP, but the web links in
DJGPP all failed.

I may check for minGW.

After ping lserv2 I got :
no answer from lserv2

So I know what's wrong with it.

Thanks.

Jennifer