Adam Naumowicz wrote:
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.
Oh yes. This warning is harmless. gpc tries to link the unit to an executable, which, of course, doesn't work. To get rid of the warning when compiling a unit, you can use the -c switch.
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 ?
Yes, you should always use --automake which will cause GPC to recompile all units needed. (There's also --autobuild which will always recompile *all* units, but this shouldn't be necessary.)
Frank