#Compiler help
4 messages in this thread
Don-
Thanks for the information. I have some more specific questions if
you'd be so kind.
As I mentioned, I'm using the Sozobon compiler ver 1.01. Here's a
code example: #include <stdio.h> #include <stddef.h>
main() { printf("If I read this I will have succeeded!\n"); }
That's about as simple as I could get. It seems to compile and
assemble OK. Then I try to link:
Blink tri.o to tri lib ami.lib zc.lib
and the machine crashes. I even put everything in the directory I was
working in, so I know it's accessible. Supposedly, printf is defined in
stdio.h and is also in one of the libraries. Hmm… do I need to compile
the include files and link them as object files? Again, these are
rudimentary questions, the doc files are not very friendly to nonfluent C
speakers. If you don't have any experience with this compiler, maybe you
know of someone who uses it. As far as I know I have everything I need
(but knowledge). I don't have the amiga.lib but, from what I understand,
the ami.lib should suffice for the kind of code I'm using. The printf()
function is refered to in the doc.
Thnx
Steve
I see two possible problems. First, you usually want to put the
compiler library before amiga.lib. There are some functions that exist in
both, and you usually want the ones from the compiler library. Second,
there is some startup code that has to go before your program code. With
Lattice, this is called c.o. I don't remember what ZC calls it (I deleted
it a few months back 😉 In any case, your link step should look something
like:
BLINK FROM Startup.o Myprog.o to myprog lib zc.lib amiga.lib
I sent you an earlier message suggesting you reference your LIBS in the
BLink. Please ignore that message as you appear to be doing so.
In case I haven't mentioned it, I used to use zc a while back before I
finally got around to updating to Lattice.
No, you do not have to compile your include files to objects.
Did you try using the cc command that came with zc? With that, all you
have to do is — cc tri.c and your program should be compiled and linked.
I have just looked at all the documentation that I have, and it seems as
though your Blink statement is OK. However, every thing I look at seems to
use capital letters for LIB. Could Blink be case sensitive?
BobS
Steve,
No…the .h files would generate no code (or should generate no
code), they are just definition files.
Put zc.lib before the ami.lib in your link statement.
Not having seen their stdio.h, I can't say for sure, but printf()
shouldn't be defined there…it's normally a library function. It may be
prototyped there though (just a line that lets the compiler know what type
of function it is) but should have an 'extern' in front of it's prototype.
Don