[comp.sys.atari.st] help for C novice with sozobon

Peter_Lawrence_Jackson@MTSG.UBC.CA (08/27/89)

Help!  I am a fortran programmer trying to learn C using the sozobon/dlibs
package. I can't get the compiler to work on the following hello world
program:
#include <stdio.h>
main()
{
printf("hello world, its me!!!\n");
}
 
I am using a floppy based 520ST with the binaries in ram disk d: with 
gulam as the shell. From d: when I type
make a:hello.tos
  I get: make:Error code -33. When I try to make from a:\sozobon\bin I get
make:Don't know how to make a:hello.tos.  When I type
cc a:hello.c -o a:hello.tos      I get cc:compiler failed.
 
I'm sure that I'm doing something basic (and simple) incorrectly. If anyone
can offer help, it would be greatly appreciated.
Peter.
(usermeso@mtsg.ubc.ca   or usermeso@ubcmtsg.bitnet)

uace0@uhnix2.uh.edu (Michael B. Vederman) (08/27/89)

In article <1758193@mtsg.ubc.ca> Peter_Lawrence_Jackson@MTSG.UBC.CA writes:
>Help!  I am a fortran programmer trying to learn C using the sozobon/dlibs
>package. I can't get the compiler to work on the following hello world
>program:
>#include <stdio.h>
>main()
>{
>printf("hello world, its me!!!\n");
>}

[Stuff deleted]

>Peter.
>(usermeso@mtsg.ubc.ca   or usermeso@ubcmtsg.bitnet)

Silly you!
Of course you can't compile the program.  The proper syntax for this program is:
main() {
	printf("hello world\n");
}

(Note most compilers check to make sure that is all you can print 'hello world')
<grin>

- mike

-- 
------------------------------------------------------------------------------
Double Click Me | Double Click Software | P.O. Box 741206 | Houston, Tx, 77274
------------------------------------------------------------------------------
Support BBS: (713)944-0108 | SHADOW | DC FORMATTER | DC UTILITIES | and others

Peter_Lawrence_Jackson@MTSG.UBC.CA (08/30/89)

Many thanks to all who responded to my plea for help. It is quite
gratifying to get so much help from so many so fast! Thanks!
It turned out that the problem was twofold:
1. I didn't have enough memory in my half meg machine for a 200K
ramdisk + gulam + the running of the compiler.
2. Gulam wasn't interpreting make a:hello.tos as I thought -- it 
wanted make a:\hello.tos. (Didn't recognize a: as part of the 
path).
   Again, thanks to all who responded.
Peter. (usermeso@mtsg.ubc.ca)

greg@bilbo (Greg Wageman) (08/31/89)

In article <1758193@mtsg.ubc.ca> Peter_Lawrence_Jackson@MTSG.UBC.CA writes:
>Help!  I am a fortran programmer trying to learn C using the sozobon/dlibs
>package. I can't get the compiler to work on the following hello world
>program:
>#include <stdio.h>
>main()
>{
>printf("hello world, its me!!!\n");
>}
> 
>I am using a floppy based 520ST with the binaries in ram disk d: with 
>gulam as the shell. From d: when I type
>make a:hello.tos
>  I get: make:Error code -33. When I try to make from a:\sozobon\bin I get
>make:Don't know how to make a:hello.tos.  When I type
>cc a:hello.c -o a:hello.tos      I get cc:compiler failed.

The Atari requires the backslash character between the drive specifier
and the directory, thusly: a:\hello.c

No doubt your problems will disappear when you specify the filename
correctly.  In addition, if your makefile is set up properly, you
shouldn't need a drive specifier at all.  If your rule looks like

hello.tos : hello.c
	cc -o hello.tos

then the command "make hello.tos" should be sufficient, assuming your
environment specifies the correct search path to find the compiler and
the libraries.

Hope this helps.



Greg Wageman			DOMAIN: greg@sj.ate.slb.com
Schlumberger Technologies	UUCP:   {uunet,decwrl,amdahl}!sjsca4!greg
1601 Technology Drive		BIX:    gwage
San Jose, CA 95110-1397		CIS:    74016,352
(408) 437-5198			GEnie:  G.WAGEMAN
------------------
Opinions expressed herein are solely the responsibility of the author.

n62@nikhefh.hep.nl (Klamer Schutte) (08/31/89)

In article <1989Aug30.212827.19235@sj.ate.slb.com> greg@sj.ate.slb.com (Greg Wageman) writes:
>In article <1758193@mtsg.ubc.ca> Peter_Lawrence_Jackson@MTSG.UBC.CA writes:
>>Help!  I am a fortran programmer trying to learn C using the sozobon/dlibs
>>package. I can't get the compiler to work on the following hello world
>
>No doubt your problems will disappear when you specify the filename
>correctly.  In addition, if your makefile is set up properly, you
>shouldn't need a drive specifier at all.  If your rule looks like
>
>hello.tos : hello.c
>	cc -o hello.tos
>
>then the command "make hello.tos" should be sufficient, assuming your

Lets fix it now to a correct one:

make the makefile as
hello.tos: hello.o
	cc -o hello.tos hello.o

and typing "make" should be sufficient.

Klamer.

-- 
________________________________________________________________________________
Klamer Schutte      mcvax!nikhefh!{n62,Schutte}     {Schutte,n62}@nikhefh.hep.nl