(OCamlfind) build library with dependencies to Core

499 Views Asked by At

I'm trying to build a small library that has dependencies to Core and Core_extended. I followed the instructions under Where to place a shared utility module in OCaml? and installed the library in ocamlfind (declaring a dependency to Core_extended and Core in the META-file). Using it in the top-level works fine now.

However, when I try to build a test-file using this library, it doesn't detect the dependencies to Core and Core_extend automatically. Using these compile instructions

ocamlfind ocamlopt -c -g -package my_lib -thread -o file.cmx file.ml

ocamlfind ocamlopt -g -linkpkg -package my_lib -thread file.cmx -o file.native

I get the following error:

Error: No implementations provided for the following modules:

   Core referenced from /.../mylib.cmx

   Core_extended referenced from /.../mylib.cmx

If I compile the file using the extra arguments "-package core_extended" then it compiles, however this is quite impractical.

Is there a way to make this dependency transparent to the compilation-process, such that "-package my_lib" automatically loads in Core and Core_extended?

EDIT: This is the content of my META-file:

name="my_lib"
description="small library"
version="0.1"
depends="core,core_extended"
archive(byte)="my_lib.cmo"
archive(native)="my_lib.cmx"

EDIT2:

Renaming "depends" to "requires" in the META-file fixed this!

1

There are 1 best solutions below

0
On

You should write requires instead of depends