English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
compiling ocaml into a shared object
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-12-14 (13:10)
From: Hendrik Tews <H.Tews@c...>
Subject: compiling ocaml into a shared object

could somebody tell me how to compile ocaml sources into a shared
object that can be loaded with dlopen? The following message
seems to tell me that this is possible:

I tried 

  ocamlopt -output-obj -o ocaml-dlex.so dlex.ml 

but on 

  dlopen ("/home/tews/src/ocaml/ocaml-dlex.so", RTLD_LAZY);

I get 

  dlopen error: /home/tews/src/ocaml/ocaml-dlex.so: only ET_DYN and ET_EXEC can be loaded

Passing -ccopt -shared to ocamlopt changed nothing. In fact it
seems that -output-obj discards all -ccopt options!