marmistrz
marmistrz

Reputation: 6414

How to link with Benchmark in OCaml

I created a simple file

benchmark.ml:

open Benchmark ;;

print_string "It works!"; print_newline() ;;

Then I tried to build it with the following contents of my Makefile

# put here the names of your source files (in the right order)
SOURCES = benchmark.ml

# the name of the resulting executable
RESULT  = benchmark

# generate type information (.annot files)
ANNOTATE = yes

# make target (see manual) : byte-code, debug-code, native-code, ...
all: debug-code

include OCamlMakefile

But I get the error:

Unbound module Benchmark

What should I do to fix it? I tried using INCDIRS or PACKS but to no avail.

Upvotes: 0

Views: 44

Answers (1)

rafix
rafix

Reputation: 1749

PACKS is the right solution.

Just don't name your file benchmark.ml, if you intend to use another module, that is already called Benchmark.

Upvotes: 1

Related Questions