rupp@tetra.UUCP (William L. Rupp) (12/04/85)
I have purchased POWER-C for the Commodore-64 from Proline. Unfortunately, I am unable to figure out from the documentation how to compile and run a simple one (main) function program. The compiler is described, and the linker as well, but the procedure for a program which does not need to be linked to another object file is not there, so far as I can tell. Being a beginner in C, I suppose I am missing something very basic, here, but I do want to figure out how to make it work. Anybody familiar with POWER-C?
rupp@tetra.UUCP (William L. Rupp) (12/04/85)
I recently bought the C compiler for the Commodore 64 put out by Proline. The
package looks very good, but I have not had any luck in compiling even a
very short program such as the following:
/* a sample program */
#include <stdio.h>
main()
{
printf("This is a test.");
}
The documentation speaks about the compiler and then the linker, but does not
indicate how a simple single function program like the one above is changed
from an object file (assuming that I could successfully compile the source) to
an executable program. The documentation seems to assume that two or more
object files will always be linked together.
I would appreciate information from anyone familiar with Proline C. I
appologize if my beginner's questions seem simplistic.
rgenter@bbn-labs-b.arpa (12/06/85)
You always need to use a linker. This will link your simple program with the C library (where things like printf are defined). -------- Rick Genter BBN Laboratories Inc. (617) 497-3848 10 Moulton St. 6/506 rgenter@bbn-labs-b.ARPA Cambridge, MA 02238
jrg@hpda.UUCP (Jeff Glasson) (12/11/85)
In article <119@tetra.UUCP> rupp@tetra.UUCP (William L. Rupp) writes: >I recently bought the C compiler for the Commodore 64 put out by Proline. The >package looks very good, but I have not had any luck in compiling even a >very short program such as the following: > >/* a sample program */ > >#include <stdio.h> > >main() > >{ > >printf("This is a test."); > > >} > >The documentation speaks about the compiler and then the linker, but does not >indicate how a simple single function program like the one above is changed >from an object file (assuming that I could successfully compile the source) to >an executable program. The documentation seems to assume that two or more >object files will always be linked together. To compile and link the above program: First compile the program using cc (eg. cc test.c). This produces a .o file. To create an executable out of the .o, you must use the linker to link in the runtime and library routines. Invoke link then issue the commands: > test.o ; specify the .o file > ^ ; tell the linker to search the libraries ; make sure the library disk is in before ; you hit return! > <cr> If all goes well, link will now ask for the name of the executable you wish to write. If there are still undefined externals, link will tell you and return the ">" prompt. Hope this helps! Jeff Glasson Hewlett-Packare ISO {ucbvax,hplabs}!hpda!jrg