I just got home and received African Chief's advice and thought I would try African Chief's fix out with Cygwin (I haven't got Linux at home yet). I first tried the version that worked on Linux, but got error messages with Cygwin. My files are pcallc.p, ccall.c, ccall.h and Makefile. The error messages are at the bottom.
I would be grateful for any ideas.
Thanks, Chris
pcallc.p: [ program pascalcallsC(input,output);
procedure world; external name 'world';
begin writeln("Hello world from Pascal"); world; end. ]
ccall.c: [ #include <stdio.h> #include "ccall.h"
void world (void) { printf("\nHello World from C\n"); } ]
ccall.h: [ extern void world(void); ]
Makefile: [ pcallc : pcallc.p ccall.o gpc -o pcallc pcallc.p ccall.o ccall.o : ccall.c gcc -c ccall.c clean: rm *.o pcallc ]
Error messages (typed manually - don't know how to cut and paste from a bash X console!): [ /usr/lib/gcc-lib/i686-cygwin/3.2.3/libgpc.a(rts.o)(.text+0x18ef):rts.c: undefined reference to `_ftruncate64' /usr/lib/gcc-lib/i686-cygwin/3.2.3/libgpc.a(rts.o)(.text+0x18b4):rts.c: undefined reference to `_lseek64' collect2: ld returned 1 exit status make: *** [pcallc] Error1 ]
Dr Christian Hicks Senior Lecturer, School of Mechanical & Systems Engineering, Stephenson Building, University of Newcastle upon Tyne, NE1 7RU. Phone: +44 191 222 6238 Mobile 0795 8317804 Fax: + 44 191 222 8600 Homepage: http://www.staff.ncl.ac.uk/chris.hicks