Adam Naumowicz wrote:
Hello, I hava a primitive question but please don't be mad at me (you know, I don't know gpc at all). How to prepare a unit file for using in normal USES declaration. I did it how I used to with BP, but all I got was error message from GPC that 'undefined refference' to function from my unit occured.
You do it just like you would in BP. For examples, you can look at the included units in the "units" directory.
If you still get errors with your code, please post the relevant code and the exact errors messages you get.
Oh yes, and in case you're using the (very old) version 2.0, I'd recommend to upgrade to a recent alpha or beta version (already much more stable than 2.0), available from (though I think units did also work in 2.0):
ftp://agnes.dida.physik.uni-essen.de/gnu-pascal/alpha/ ftp://agnes.dida.physik.uni-essen.de/gnu-pascal/beta/
Frank
Thanks for answering, I already have quite new version of the compiler taken from the net. I noticed that if I try to compile my unit file test1.pas I get a warning:
c:\gpc\lib/crt0.o(.data+0xc2):crt0.s: undefined reference to 'main' c:\gpc\lib/libc.a(crt1.o)(.text+0x446):crt1.c: undefined reference to 'main'
and a .gpi file is created. When I compile a program using test1 the following error occures:
c:/gpc/tmp\cceaaaaa(.text+0xad):test.pas: undefined reference to 'First'
where First is an identifier of a function from test1. But if i compile my program with --automake switch everything goes all right. Do I always have to turn on the build mode ?
-------------------------------------- Adam Naumowicz email: adamn@math.uwb.edu.pl WWW : http://math.uwb.edu.pl/~adamn/ ---------------------------------------