From: Frank Heckenbach <frank@g-n-u.de> To: gpc@gnu.de Subject: Re: beta distribution Date: Fri, 30 Jun 2000 20:35:04 +0200
You need to link the C code. For a simple C file, you can insert `{$L foo.c}' into the unit, and GPC will automatically compile the C file. For a library libbar.a, you can use `{$L bar}' in the source which is equivalent to `-lbar' on the command line.
I am not sure to understand. Do I have to put {$L randlib.c} in beta.p like this: unit beta; interface {$L randlib.c} function genbet(x,y:shortreal):shortreal;C; implementation end. and keep my program called 'test' like this: program betadev; uses beta; begin writeln(genbet(100,150)); end. and after if I compile the first one, the following message appears: beta.p:5: file `randlib.c' not found and for the second one: Undefined first referenced symbol in file genbet /var/tmp/cc5OaGYv1.o ld: fatal: Symbol referencing errors. No output written to test collect2: ld returned 1 exit status When you say "For a library libbar.a, you can use `{$L bar}' in the source which is equivalent to `-lbar' on the command line.", what is the source in this case? Thanks in advance, Nathalie ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
participants (1)
-
Nathalie Jarosz