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
[Caml-list] OCaml/C++ : STL conflicts
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-04-23 (11:52)
From: Gregoire Sutre <sutre@i...>
Subject: [Caml-list] OCaml/C++ : STL conflicts

I would like to use a C++ library in an OCaml program.  Fortunately, the
linking problems were solved quite easily:

(1) declaring each external C++ function as extern "C"
(2) enlosing the caml/* includes inside an extern "C"
(3) specifying the C++ compiler with the -cc option of ocamlc/ocamlopt

But I have not tested thoroughly yet.  Do you believe that there might be
problems with this approach?

Regarding (2) above, I was by the way surprised that the caml/* header
files did not use the usual construct:

#ifdef __cplusplus
extern "C" {

To unsubscribe, mail  Archives: