On 24 May 2010, at 13:59, vt...@volny.cz wrote:
> is it possible to link FPC compiled units to a C program on Linux?
> I'm not able to figure it out.
> FPC uses some strange way to name symbols and whatever I try, I always
> end up with the linking errors.
> I'm probably doing some trivial error
YES! Thank you very much. You saved my day (maybe more of them, if I
had to rewrite all the pascal code to C) :)
> Ah, sorry, that would be for the other direction =)
>
> This one should work:
>
> function aplusb(a,b:longint):longint;cdecl; public
> name '_aplusb';
>
> --
> Felipe Monteiro de
Ah, sorry, that would be for the other direction =)
This one should work:
function aplusb(a,b:longint):longint;cdecl; public name '_aplusb';
--
Felipe Monteiro de Carvalho
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepa
I probably just found a way!
alias '_aplusb';
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
try:
function aplusb(a,b:longint):longint;cdecl; external name '_aplusb';
--
Felipe Monteiro de Carvalho
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Hi a thank you for quick reply, but I've tried that before:
Fatal: Syntax error, ";" expected but "identifier NAME" found
Could it be mode dependant? (I use -Mobjfpc)
V.
> It's normal name mangling, just like C++ also does.
> To force a
> specific name try something like this:
>
> function apl
It's normal name mangling, just like C++ also does. To force a
specific name try something like this:
function aplusb(a,b:longint):longint;cdecl name '_aplusb';
--
Felipe Monteiro de Carvalho
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org