#C Beginner
7 messages in this thread
Tom-
I sure appreciate the responce. To be more specific, I'm having
trouble merely setting up. The number of files and the similarities of
their dir names and extensions has me a little intimidated. I mean, I
understand a little of the fundamentals, includes are the headers that go
in the code itself, libraries are added at link-time, there is usually
(always?) an object file than is called a startup file, also added at
link-time. I did what I thought the docs required as far as setup, but
evidently I haven't. At the risk of confusing the story, the problem I had
with ZC was that after compiling, assembling and, evidently, linking, the
programs were not executable. These programs were as simple as the "Hello,
world" thing. The point is, my problem seems not so much to be with C as
much as with my tools. Maybe you'd be kind enough to give me a hand with
just setting up my environment. Oh yea, when I try run DCC, I get a prompt
to insert the volume "ENV:" if that is any clue.
Thnx
Steve
Uhh, do you know how to use the Assign command from CLI? In the meantime
I'll setup DICE on a dual-floppy basis and let you know where I put stuff.
Haven't looked at DICE yet (plan to,b ut haven't had the time to download
the huge file 8-), but it sounds like you have to set some environment
variables. To get started, you can assign ENV: (which is where environment
variables go) to ram: like this:
assign ENV: ram: (of course, if your ram disk is named something
else, use that name!) Then look thru the DICE-doc to see if it mentions any
environment variables that need to be set (most likely w/ the AmigaDOS
setenv command). That should get ya at least a little further along.
-Mike
Steve,
Once you unarc all the DICE files to a disk, you can start by ignoring
everything except the directories named BIN, DINCLUDE, & DLIB. These
directories contain all the files you'll probably be needing. BIN contains
the executables dcc, dpp, etc. DINCLUDE is where all of the files to be
included (ie., #include <filename> ) are stored, and DLIB is where all the
libraries to be linked (the startup code, etc.) are stored. Here is a
script I use when I want to run DICE from a floppy drive (assuming DICE is
the name of my disk):
assign dlib: DICE:dlib
assign dinclude: DICE:dinclude
copy >NIL: DICE:bin all to ram:c
stack 20000
Now, instead of copying BIN to ram:c, you might want to just add BIN to
your search path or make the files in BIN resident, depending on how much
ram you have to play with. You need to place Amiga.lib (from the 1.3 Dev.
Kit) in DLIB (for large data/large code work, otherwise you have to run it
through LIBTOS from the DICE:C directory, this will also save some space).
In the DINCLUDE directory you have to make a subdirectory called AMIGA, in
this subdirectory you copy all the INCLUDE.H files from the "INCLUDE 1.3
STRIP" disk (again, from the 1.3 Native Developer's Kit). These last two
step assume you want to use Amiga specific routines & have the 1.3
includes.
The script above assumes that your startup-sequence is creating all the
directories you need in ram: or that they exist on a floppy that is
accessable while compiling. Especially important is the T: directory, this
is where all the intermediate output files go, run DCC with the -v verbose
flag to see how/what. My T: is in ram, but if you're short on ram, assign
it to a floppy. I assume DICE uses the ENV: directory since you got a
requester asking for it, compare your startup-sequence to the original from
boot disk that came with your Amiga, make sure you haven't deleted any of
the ASSIGNs or MAKEDIRs, I believe you need them all.
DICE is memory hungry, I compiled a "datafied" Image, orginally of 48K
[ MORE ]
[ continuation ]
size, and had to use about 2.8M of ram, along with a blank floppy, and had
to run each step individually to create an object file that I could link
with the rest of my program. (How much are HDs these days??) But usually I
can compile most things in 600-700K of ram. I hope this helps. I'm not an
expert, but will try to answer any other DICE questions you have.
–Fran
DICE looked too complicated to set up, so that is why I got NorthC. It is
very easy to use and fairly fast and doean't seem to be memory hungry, as I
am using it on a 1 meg A500 with 2 floppy drives. All you need to do is
type:
cc -o(executable filename) (source filename)
like this: cc -oHello hello.c That's all there is too it, it takes
care of the object stuff, the linking, and all.
I guess 'removing the /Lattice' from your name answers my question of
whether your going to still be around. Great.
—Mike