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
C++ & Caml: name clash
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-04-19 (13:08)
From: Ohad Rodeh <orodeh@c...>
Subject: C++ & Caml: name clash
  First of all, I'd like to thank all the replies for my
first question. 
  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. 

  A simple solution is to recompile the Caml distribution
with a compiler flag that will modify alloc to, say, caml_alloc. 
However, I will need to distribute, along with my code, a
different version of Caml. Since this code is included in a much
larger software distribution (Ensemble), this is not an option.

  What do you suggest?