Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uwvax!umn-d-ub!umn-cs!thelake!steve From: steve@thelake.mn.org (Steve Yelvington) Newsgroups: comp.sys.atari.st Subject: Re: Help with Sozobon|| Message-ID: <0017900052080999@thelake.mn.org> Date: 17 Jan 90 06:52:08 GMT References: <1037T6M-RIIT@FINTUVM> <7503@shlump.nac.dec.com> Organization: Otter Lake Leisure Society (White Bear, Minnesota, USA) Lines: 93 X-Member-Of: STdNet, the ST Developers' Network [In article <1037T6M-RIIT@FINTUVM>, T6M-RIIT@FINTUVM.BITNET writes:] > I'm trying to learn C with Sozobon. I already got my *first* program > written and I've been trying to compile it with no remarkable success. > > 1) Tried cc: > cc hello > (why do the first programs always say hello?...) > A comment returned: can't find library 'HELLO' > No library found? Well, let's name one.. > cc hello libm > - got the same line again. > OK, I'll give up. You gave up two keystrokes too quickly. Try "cc hello.c". If cc sees a filename with no .ext, or with .a, or with .lib, it thinks it's a library. You said "cc hello" and cc looked for a library named hello. It didn't find one. > > 2) Let's try the other way, do it piecewise. > hcc hello.c > goes fine. Got a nice assembly language file hello.s. But it sure > could use some optimization: > top hello.s > Yap, the file sure looks prettier (and a whole lotta shorter). Yeach, the raw, unoptimized output from hcc looks pretty bizarre. :-) > Now > let's assemble it to hello.o. > jas hello.s > ...the program spits out words of warning: > usage: as [-N] source [-o object] > and dammit that's just what I gave 'im, ain't it? (except the spelling > error - Joe's missing?) This one has me stumped; I "jas source.s" all the time without any trouble. If jas is getting a filename, it should assemble it. As Bill Powers pointed out, Pcommand may be the culprit. It does some goofy things. Try gulam. > 3) Well well, there is still the make utility (the doc of which I just > can't understand and got no UNIX manual at hand). I cook up a file > called MAKEFILE with > hello.tos: hello.o > cc -o hello.tos hello.o > in it - copied straight from a USENET news article sometime in August. > Wonder if there's any sense in this... well, type make. > "No targets provided near line 2". I take the monitor and smash it on > the wall and eat the ST and go hang myself. This, of course, is the primary purpose of make. By causing budding programmers to smash monitors and hang themselves, the supply of programmers is restricted, and salaries can be kept high. Seriously, using make to maintain a program with fewer than half a dozen source files is just a pain in the gazoo. Forget about make until you've got C under control. [In article <7503@shlump.nac.dec.com>, powers@engles.enet.dec.com (Bill Powers) writes ... ] > On the environment variables, try including > a last '\' (backslash) some programs won't automatically add one I don't > use sozobon, so I don't know if this is happening. Sozobon C expects that paths will NOT end in a backslash. The source code for cc indicates these default search paths: /* * Default paths for executables and libraries * * Always check the root of the current drive first. */ #define DEFPATH "\\bin,\\sozobon\\bin" #define DEFLIB "\\lib,\\sozobon\\lib" #define DEFTMP "" ... so if the programs and libraries are on the current drive, you usually don't have to define the environment variables. I often compile on D: while the Sozobon directories are on C:, so I have set up: PATH=.,\bin,c:\bin INCLUDE=c:\sozobon\include LIB=c:\sozobon\lib -- Steve Yelvington at the (thin ice today*) lake in Minnesota UUCP path: ... umn-cs.cs.umn.edu!thelake!steve *16 cars through the ice so far this year! Yes, you, too, can have that sinking feeling....