backtracking / ocamlgraph

OCaml graph library
http://backtracking.github.io/ocamlgraph/
Other
233 stars 60 forks source link

"The type `edge' is required but not provided" when running demo #70

Closed ethanluoyc closed 6 years ago

ethanluoyc commented 6 years ago

Hi I cloned the repo and was trying to get the demos running. However, I get the following error:

mkdir -p bin ocamlopt.opt -o bin/compare_prim_kruskal.opt graphics.cmxa unix.cmxa graph.cmxa examples/compare_prim_kruskal.ml 

File "examples/compare_prim_kruskal.ml", line 103, 
characters 25-26: Error: Signature mismatch: 
       ...        
The type `edge' is required but not provided make: *** [bin/compare_prim_kruskal.opt] 
Error 2

I tried this on both OCaml v4.02.3 and v4.04.2, neither seems to work for some reason. This is rather confusing to me as I thought the with clause at https://github.com/backtracking/ocamlgraph/blob/master/src/prim.mli#L37 would resolve the interface problem. I am quite new to ocaml so maybe I am missing something here...

ethanluoyc commented 6 years ago

Additional note, this might be related to #47, the first comment in the issue seems to be unaddressed?

yakobowski commented 6 years ago

This example was not compiled by default, and it has bitrotted. Sorry for this.

The with clause in the required interface does not free you from declaring the type edge in module W. You must declare it anyway, and OCaml will check that the declarations are compatible.