Skip to content

Failing to add C stubs with ocamljava #29

@PioBeat

Description

@PioBeat

OCaml allows to interface libraries written in C, for example. Therefore, C stubs must be added to use the C library. My question is, how can I produce a *.jar from OCaml source that has a reference to C stubs?

Consider the following library ocaml-minisat. This library is a binding to the Minisat-C-1.14.1 solver. The signature of the ocaml-minisat dependency is as follows:

module Raw : sig
  external create : unit -> t = "caml_minisat_new"
  external delete : t -> unit = "caml_minisat_delete"
  (* code omitted *)
end

The C stubs are located in the same directory with the filename libminisat_stubs.c.

Running ocamljava -c Minisat.mli works fine (the interface). After calling ocamljava -c Minisat.ml the following error is produced:

File "Minisat.ml", line 1:
Error: Primitive 'caml_minisat_new' cannot be found

Is there any way to tell ocamljava where the defined C stubs of the library are located?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions