linking pc and cc
T Borg
borg at wintermute.sdsu.edu
Fri Feb 1 03:51:31 AEST 1991
I am linking Pascal and C programs under BSD Unix and
I have come across a couple of related questions I would like to ask.
1. I have successfully linked Pascal to Pascal and Pascal to C routines.
In fact, with everything compiled to *.o files, pc appears to function
simply as ld (similar to what cc does when it is given only *.o files).
However when I try to use ld directly on these *.o files -- even if I
have the -lpc -lm -lc options declared so as to get no error messages --
I get an immediate crash at run time. Apparently there is some extra
work that pc is doing (or telling ld to do). Do you know how I can use
ld direct?
2. In Berkeley Pascal, *.h files are used to communicate global
information (type, var, procedure, function declarations). In general
it would very difficult for the included .h file to completely
follow the rules in standard Pascal about order of declarations (since
the file where the include statement appears already has its own
declarations).
The compiler, pc, appears to accept this relaxation of the rules but
still puts out a warning that things are out of order. Is it your
experience that this warning should simply be ignored (as almost
unavoidable if one wants to use external compilations)?
Thanks a lot.
More information about the Comp.lang.c
mailing list