I'm trying to make available a pascal library to the C people.
So my first step was to build a minimal example.
I've defined and exported a procedure in a library pascal file and I've made a main_c.c and a main_pascal.pp files that uses such procedure from such library.
Using gdb I follow the flux of execution, and calling seems to be correct in both cases (main_c or main_pascal).
But in the C case, when
(from inside the pascal library) the funtion writeln is called the aplication exits with error code 0147.
If the debuger is not used, the shell do not report any error at all, although the aplication exits abnormally.
I supouse the problem is that the C executable should be linked to some other libraries, or perhaps it is related to the pascal initialization of the io system or something related to standard io streams.
Could some body point me to the solution. In case the soluton comes from having to add some pascal libraries, could you specify which ones?
May is a trivial thing and I'm an stupid, but if it is a library isue it would help having a comment in the docs around the libraries that
should be linked with,...
NOTE 1:
The compiler I'm using is:
Free Pascal Compiler version 1.0.4 [2000/12/18] for i386 Copyright (c) 1993-2000 by Florian Klaempfl
NOTE 2: I've attached a tgz file with a directory with the files pertaining to the above mentioned example, for if it helps.
Thanks in advance.
