[Gambas-user] error calling external function from c library

Benoit Minisini gambas at ...1...
Thu Jun 19 23:53:41 CEST 2008


On jeudi 19 juin 2008, Marcos Antonio Pandolfo Jr wrote:
> In gambas 2.7.0 appears Illegal instruction in the call of function
> TEF_inicia:
>
> EXTERN TEF_inicia(Resultado AS Pointer, Funcao AS String, Valor AS String,
> CuponFiscal AS String, DataFiscal AS String, Horario AS String, Operador AS
> String, ParamAdic AS String) IN "libclisitef" EXEC
> "IniciaFuncaoSiTefInterativoA"
>
> PUBLIC SUB Main()
> DIM la AS Pointer
> DIM lala AS String
>
> la = Alloc(4)
> TEF_inicia(la, "000000", "{200,00}", "{12345}", "20080618", "100000",
> "{MARCOS}", "{}") 'gambas say illegal instruction in this line
> lala = StrPtr(la)
> Free(la)
> PRINT lala
>
> Now is the call correct ?
>
> Thanks so much for the help and sorry my poor english.
>
>

I don't know: you must ensure that the EXTERN declaration exactly matches the 
binary interface of the called function (i.e. its C declaration), and the 
called function may crash too, not Gambas itself.

-- 
Benoit Minisini




More information about the User mailing list