Version française
Home     About     Download     Resources     Contact us    
Browse thread
Shared libraries with ocamlopt callable from C (without main())?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Matthieu Dubuget <matthieu.dubuget@g...>
Subject: Re: [Caml-list] Shared libraries with ocamlopt callable from C (without main())?
Ben Aurel a écrit :
> I'm thinking about the possibility to use OCaml as an extension
> language. If I wanted to call a OCaml function from langX I had to use
> a C wrapper.
>
>     langX -> ( C API of langX | C Wrapper | C API of OCaml ) -> OCaml
>   

Yes

> But could somebody tell me if ( and maybe how ) this can be done. I made some attempts, but
> there is always a main() function involved. But this C wrapper would be a shared library.
>   

Exactly. You can deliver your OCaml code as shared library, and then
call it from
any language that can call a shared library.

Could you point out what problem you faced?

Salutations

Matt