You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1400 Reporter: administrator Status: closed Resolution: not a bug Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
I'm currently developing a native library for OCaml with C++. Everything seems
to compile ok, but in the linking phase it complains about missing ocaml
functions (such as failwith, alloc and alloc_tuple). The problem is, that the
ocaml header files do not specify 'extern "C"' for function declarations under
C++ (they should be defined as 'extern' under C, but this is not done either, as
I see it).
Original bug ID: 1400
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Jere Sanisalo
Version: 3.05
OS: WinXP
Submission from: ip213-185-36-33.laajakaista.mtv3.fi (213.185.36.33)
I'm currently developing a native library for OCaml with C++. Everything seems
to compile ok, but in the linking phase it complains about missing ocaml
functions (such as failwith, alloc and alloc_tuple). The problem is, that the
ocaml header files do not specify 'extern "C"' for function declarations under
C++ (they should be defined as 'extern' under C, but this is not done either, as
I see it).
A quick hack is to include the header files like:
extern "C" {
#include <caml/alloc.h>
#include <caml/fail.h>
#include <caml/memory.h>
#include <caml/mlvalues.h>
}
This compiles, links and works as expected (but is a temporary hack
nonetheless).
The text was updated successfully, but these errors were encountered: