[fpc-devel]LINKING a pp library from a MAIN.C produces ERROR when calling WRITELN? (Moderator note: downsized...)

Javier Ros Ganuza jros at unavarra.es
Tue May 22 18:42:17 CEST 2001

I'm trying to make available a pascal library to the C

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,...

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.

Javier Ros Ganuza.
Dpto. Ingeniería Mecánica./Ingeniaritza Mekanika Saila.
Univ. Pública de Navarra./Nafarroako Unibertsitate Publikoa.
 Campus de Arrosadia s/n. 31006 Iruñea.
Tel. 34 948169307 Fax. 34 948169099
-------------- next part --------------
A non-text attachment was scrubbed...
Name: c_interface.tgz
Type: application/octet-stream
Size: 821 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20010522/895e064b/attachment.obj>

More information about the fpc-devel mailing list