Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Threads Library
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-01-16 (21:28)
From: skaller <skaller@m...>
Subject: Dynamic loading and building of shared libraries
I have a need to load sets of ocaml functions at run time
in Viper using dlopen: this requirement arises from Python's
ability to dynamically load C extension modules: Viper
emulates this by loading text files which provide
equivalent functionality, but these files must use
native functions to provide the functionality.

At the moment, these functions must be statically
linked into the interpreter, which is not really acceptable.

It should be easy to provide a C factory function in a shared
library that returns a table of functions: my question is,
how to tell ocaml to link a shared library, rather than
a main executable.

How do I do this? If not, can a way be devised to tell
ocamlopt to do it? Or is there a reasone it isn't possible?

John (Max) Skaller,
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850