Board index » kylix » Binding kylix .so to other languages

Binding kylix .so to other languages


2006-06-21 06:11:35 PM
kylix0
Hi,
i've got an .so library which was written in Kylix and the corresponding
Kylix .pas header file.
Now i want to use this from another language, preferrable C (i.e. write
a language binding for C)
Whats the best way to do this?
The background:
It's a communication library for a PLC device, and the only way to
interact with this PLC from within Linux right now is to use
Kylix applications.
But as Kylix is a little bit dead, i would like to use the existing
library with another language, like Ruby or something like that. I guess
the most useful way to do would be the possibility to use it with C and
then write (or let generate) a binding for higher level languages.
Thanks and greets,
HJ
 
 

Re:Binding kylix .so to other languages

Hans-J. Becker schrieb:
Quote
Hi,

i've got an .so library which was written in Kylix and the corresponding
Kylix .pas header file.

Now i want to use this from another language, preferrable C (i.e. write
a language binding for C)

Whats the best way to do this?


The best way is to ask google first ;-)
groups.google.com/group/borland.public.kylix.linuxapi/browse_thread/thread/7d6ad2cc12f8d802
 

Re:Binding kylix .so to other languages

Hi Theo,
theo < XXXX@XXXXX.COM >wrote:
Quote
Hans-J. Becker schrieb:
>Hi,
>
>i've got an .so library which was written in Kylix and the corresponding
>Kylix .pas header file.
>
>Now i want to use this from another language, preferrable C (i.e. write
>a language binding for C)
>
>Whats the best way to do this?
>
>

The best way is to ask google first ;-)

groups.google.com/group/borland.public.kylix.linuxapi/browse_thread/thread/7d6ad2cc12f8d802
Thanks!
I've tried that but didn't find that article. What search terms did you use?
This was exactly what i needed.
"Calling convention" was the thing i was looking for, but didn't know it ;-)
I don't have the source of the library, but defining my functions in my C header with __attribute__ ((regparm(3))) to switch to register parameter passing was the trick!
Now everything seems to work :)
You've saved my day!
 

{smallsort}

Re:Binding kylix .so to other languages

Quote

I've tried that but didn't find that article. What search terms did you use?
Just some of the obvious:
groups.google.com/groups/search
Quote


You've saved my day!
Fine!