From: Vu Ngoc San <san.vu-ngoc@laposte.net>
To: caml-list@inria.fr
Subject: [Caml-list] Warning 31: files b.cma(Str) and a.cma(Str) both define a module named Str
Date: Fri, 06 Mar 2015 11:16:08 +0100 [thread overview]
Message-ID: <54F97E68.3010100@laposte.net> (raw)
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
next reply other threads:[~2015-03-06 10:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-06 10:16 Vu Ngoc San [this message]
2015-03-06 10:44 ` Pierrick Couderc
2015-03-06 10:53 ` ygrek
2015-03-06 11:08 ` Vu Ngoc San
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54F97E68.3010100@laposte.net \
--to=san.vu-ngoc@laposte.net \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox