caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Ohad Rodeh <orodeh@cs.huji.ac.il>, caml-list@inria.fr
Subject: Re: C++ & Caml: name clash
Date: Wed, 19 Apr 2000 19:40:37 +0200	[thread overview]
Message-ID: <20000419194037.51245@pauillac.inria.fr> (raw)
In-Reply-To: <Pine.LNX.4.20_heb2.08.0004181054550.12299-100000@zigzag.cs.huji.ac.il>; from Ohad Rodeh on Tue, Apr 18, 2000 at 11:08:13AM +0300

>   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



      parent reply	other threads:[~2000-04-19 18:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <38FC05D8.61652265@in.ot.com.au>
2000-04-18  8:08 ` Ohad Rodeh
2000-04-19 15:50   ` John Max Skaller
2000-04-19 17:40   ` Xavier Leroy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20000419194037.51245@pauillac.inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=orodeh@cs.huji.ac.il \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).