Hello list
I have a basic compilation question:
I want to write two independent libraries, say A an B, and both use a third library, eg. Str
When I write a program which uses A and B, I get
File "b.cma(Str)", line 1:
Warning 31: files b.cma(Str) and a.cma(Str) both define a module named Str
How to get rid of this warning ? Am I doing something wrong ?
Thanks
San
----
Here is a minimal example:
(* This is a.ml *)
let version = "A";;
let _ = print_endline (Str.string_before "Loading the A library -- foo" 22);;
(* This is b.ml *)
let version = "B";;
let _ = print_endline (Str.string_before ("Loading the " ^ version ^" library -- bar") 23);;
# this is Makefile.a
SOURCES = a.ml
LIBS = str
RESULT = a
all: byte-code-library
-include OCamlMakefile
# this is Makefile.b
SOURCES = b.ml
LIBS = str
RESULT = b
all: byte-code-library
-include OCamlMakefile
(* this is test.ml *)
let _ = print_endline (Str.string_before ("Hello " ^ A.version ^ " and " ^ B.version ^"---") 13);;
# this is Makefile.test
SOURCES = test.ml
LIBS = a b
RESULT = test
all: byte-code
-include OCamlMakefile
--
Caml-list mailing list. Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs