Angelo.Fumagalli@alcatel.it wrote:
we are using gpc-20041218 with gcc-2.95.2 on Sparc Solaris 2.8 and we found a gpc link problem when linking user object file compiled separately and then linked in a final step.
For example, a simple case: if we have two gpc source files (a program pi.pas which calls a procedure defined in a separeted unit ui.pas which uses the gpc Trap unit) compiled in different steps and then linked together in a final step, the references related to the gpc unit remain undefined when linking/loading the object files, for example:
gpc --automake -c ui.pas -o ui.o gpc --automake -c pi.pas -o pi.o gpc --automake pi.o ui.o -o p.exe
You're mixing two partly incompatible methods, automake and explicit linking.
Remove all *.o and *.gpi files (to be sure), then do just `gpc --automake -o p.exe pi.pas' (assuming that's your main program).
(The issue is that the Trap unit uses another file, trapc.c. Automake deals with it transparently due to a `{$L}' directive, but only if you let it.)
You might also want to try gp (http://fjf.gnu.de/misc/gp.tar.bz2) which is planned to replace automake in the future. After installing it, call it like gpc (you can omit the `--automake' option then which gp just ignores).
Frank