English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
c++ files support in ocamlc, ocamlopt & ocamlbuild
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-03-28 (21:48)
From: Vladimir Shabanov <vshabanoff@g...>
Subject: c++ files support in ocamlc, ocamlopt & ocamlbuild
OCaml compilers have support for .c files, and autmatically run CC for
compilation of those. But why there is no such support for C++ files
(.cpp, .cc, .cxx, .C)?

When I write bindings for C++ libraries I need to rename files to .c
and use "ocamlc -cc g++ ...". Or I need to compile them into some .a
library and use "ocamlc -cclib -l... -lstdc++"

With advent of ocamlbuild it would be nice for C++ files to be recognized too.
> ls
some_lib_ml.cpp some_lib.ml
> ocamlbuild some_lib_ml.o some_lib.cma
and that's all.

AFAICS it's not difficult to add support for C++ files (or maybe I'm
wrong?) Is there any plans to support those?