caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* RE: [Caml-list] C++ embedded ocaml and shared libraries
@ 2003-04-07 11:36 EL CHAAR RABIH
  0 siblings, 0 replies; 2+ messages in thread
From: EL CHAAR RABIH @ 2003-04-07 11:36 UTC (permalink / raw)
  To: 'caml-list@inria.fr'

The problem is the following :

when you compile ml files into obj, a C file is created, with the necessary
byte code (compilation of the ml). It also defines function such as startup
for initializing your byte code into the gc.

If you have several ml files, you should do the following :
compile .ml into cmo.
join all the cmo with -linkall compiler options into a .obj.

use the resulting .obj (unique) for linking your dll.

This should work.

-----Message d'origine-----
De : HAYCOCK, Ian, FM IT [mailto:Ian.Haycock@rbos.com]
Envoyé : lundi 7 avril 2003 13:11
À : 'caml-list@inria.fr'
Objet : [Caml-list] C++ embedded ocaml and shared libraries


Hi

I'm trying to embed some ocaml code into a C shared library with C code. 
I can produce a static library that does what I want, but I really need to
get a shared library and all attempts I've made so far have failed.

Basically I'm trying to compile 2 ml source files into objects and then put
these together with objects from C code, which call out to the caml code,
into the shared library. However the library creation fails telling me there
are multiply defined symbols (eg caml_startup) in the objects produced from
the 2 ml source files.

Can anybody give me a hint (or even better an example) as to how to do this.
The only examples I can find on the web relating to embedding ocaml in C and
then creating a shared library involve 1 ml file and 1 C file and in this
instance I don't get the multiple symbol problem.

Any help appreciated

thanks

Ian


********************************************************************
      Visit our Internet site at http://www.rbsmarkets.com

This e-mail is intended only for the addressee named above.
As this e-mail may contain confidential or privileged information,
if you are not the named addressee, you are not authorised to
retain, read, copy or disseminate this message or any part of it.
The Royal Bank of Scotland plc is registered in Scotland No 90312
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB
             Regulated by the Financial Services Authority
********************************************************************

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives:
http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ:
http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Caml-list] C++ embedded ocaml and shared libraries
@ 2003-04-07 11:10 HAYCOCK, Ian, FM IT
  0 siblings, 0 replies; 2+ messages in thread
From: HAYCOCK, Ian, FM IT @ 2003-04-07 11:10 UTC (permalink / raw)
  To: 'caml-list@inria.fr'

Hi

I'm trying to embed some ocaml code into a C shared library with C code. 
I can produce a static library that does what I want, but I really need to
get a shared library and all attempts I've made so far have failed.

Basically I'm trying to compile 2 ml source files into objects and then put
these together with objects from C code, which call out to the caml code,
into the shared library. However the library creation fails telling me there
are multiply defined symbols (eg caml_startup) in the objects produced from
the 2 ml source files.

Can anybody give me a hint (or even better an example) as to how to do this.
The only examples I can find on the web relating to embedding ocaml in C and
then creating a shared library involve 1 ml file and 1 C file and in this
instance I don't get the multiple symbol problem.

Any help appreciated

thanks

Ian


********************************************************************
      Visit our Internet site at http://www.rbsmarkets.com

This e-mail is intended only for the addressee named above.
As this e-mail may contain confidential or privileged information,
if you are not the named addressee, you are not authorised to
retain, read, copy or disseminate this message or any part of it.
The Royal Bank of Scotland plc is registered in Scotland No 90312
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB
             Regulated by the Financial Services Authority
********************************************************************

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-04-07 11:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-07 11:36 [Caml-list] C++ embedded ocaml and shared libraries EL CHAAR RABIH
  -- strict thread matches above, loose matches on Subject: below --
2003-04-07 11:10 HAYCOCK, Ian, FM IT

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).