On 11/13/06, Leonardo M. Ramé <[EMAIL PROTECTED]> wrote:
I created a Python.pas unit this way using Delphi and it works correctly (note 
the cdecl directive
before external):

unit python;

interface
  procedure Py_Initialize; cdecl; external 'python24.dll';
  procedure Py_Finalize; cdecl; external 'python24.dll';
  function PyRun_SimpleString(_para1:Pchar):longint; cdecl; external 
'python24.dll';

implementation
end.

Thanks Leonardo !

The trick was to add cdecl _before_  external  :

function PyRun_SimpleString(_para1:Pchar):longint; cdecl; external
name 'PyRun_SimpleString';

I had initially added cdecl _after_ the 'external' clause , but this
generated an
error ( directive CDECL has conflicts with other directives )  which confused
me into thinking that cdecl was not needed.


Thanks,
Adrian Maier
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to