Re: C++ & Caml: name clash

From: Xavier Leroy (Xavier.Leroy@inria.fr)
Date: Wed Apr 19 2000 - 19:40:37 MET DST

  • Next message: Michael Hicks: "Re: When functional languages can be accepted by industry?"

    > My second problem has to do with a name clash between
    > the g++ standard library, and the alloc.h file from Caml.
    > It turns out that the function "alloc" is defined by g++
    > in file /usr/include/g++-2/stl_alloc.h as:
    > typedef class __default_alloc_template<true,0> alloc
    > In caml it is defined in include/alloc.h as:
    > value alloc(mlsize_t, tag_t)
    >
    > This does not allow compiling a file that #includes both
    > Caml and g++ header files.

    The easiest solution, it seems, would be to split your source in two
    files, one in plain C (or perhaps C++ but not using the STL)
    containing just the Caml wrappers for your functions, and another one
    defining your functions in C++ with STL without reference to the Caml
    include files.

    Hope this helps,

    - Xavier Leroy



    This archive was generated by hypermail 2b29 : Wed Apr 19 2000 - 21:01:50 MET DST