From: Pietro A. <Pie...@an...> - 2004-02-03 01:21:28
|
Hi all, I want to distribute extlib with my project and to do so I added a Makefile to it. When compiling it on debian unstable (ocaml 3.07) everything it's ok. When I try to compile the same code, with the same makefile and ocaml 3.06 (debian woody) I get a complain about extString: [...] ocamlc -c extString.mli ocamlc -c extString.ml The implementation extString.ml does not match the interface extString.cmi: Modules do not match: sig exception Invalid_string external length : string -> int = "%string_length" external get : string -> int -> char = "%string_safe_get" external set : string -> int -> char -> unit = "%string_safe_set" external create : int -> string = "create_string" val make : int -> char -> string val copy : string -> string [...] val lowercase : string -> string val capitalize : string -> string val uncapitalize : string -> string type t = string val compare : t -> t -> int end The field `compare' is required but not provided The field `t' is required but not provided make[1]: *** [extString.cmo] Error 2 #> my naive solution was to add type t = string let compare = compare in the extString.ml file. now it compiles with ocmal 3.06, but it complains with 3.07 because there's a dup definition... is it a known problem ? attached there's the makefile (using OCamlMakefile) and the META file that might be useful having in the extlib distribution... p -- ++ Our capacity for understanding is inversely proportional to how much we think we know. The more I know, the more I know I don't know... ++ Please avoid sending me Word or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html |
From: Pietro A. <Pie...@an...> - 2004-02-03 02:24:36
|
Hi all, I want to distribute extlib with my project and to do so I added a Makefile to it. When compiling it on debian unstable (ocaml 3.07) everything it's ok. When I try to compile the same code, with the same makefile and ocaml 3.06 (debian woody) I get a complain about extString: [...] ocamlc -c extString.mli ocamlc -c extString.ml The implementation extString.ml does not match the interface extString.cmi: Modules do not match: sig exception Invalid_string external length : string -> int = "%string_length" external get : string -> int -> char = "%string_safe_get" external set : string -> int -> char -> unit = "%string_safe_set" external create : int -> string = "create_string" val make : int -> char -> string val copy : string -> string [...] val lowercase : string -> string val capitalize : string -> string val uncapitalize : string -> string type t = string val compare : t -> t -> int end The field `compare' is required but not provided The field `t' is required but not provided make[1]: *** [extString.cmo] Error 2 #> my naive solution was to add type t = string let compare = compare in the extString.ml file. now it compiles with ocmal 3.06, but it complains with 3.07 because there's a dup definition... is it a known problem ? attached there's the makefile (using OCamlMakefile) and the META file that might be useful having in the extlib distribution... p -- ++ Our capacity for understanding is inversely proportional to how much we think we know. The more I know, the more I know I don't know... ++ Please avoid sending me Word or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html |
From: Peter J. <pe...@jo...> - 2004-02-03 09:34:26
|
Pietro Abate wrote: > Hi all, > I want to distribute extlib with my project and to do so I added a > Makefile to it. When compiling it on debian unstable (ocaml 3.07) > everything it's ok. When I try to compile the same code, with the same > makefile and ocaml 3.06 (debian woody) I get a complain about extString: > > [...] > ocamlc -c extString.mli > ocamlc -c extString.ml > The implementation extString.ml does not match the interface extString.cmi: > Modules do not match: > sig > exception Invalid_string > external length : string -> int = "%string_length" > external get : string -> int -> char = "%string_safe_get" > external set : string -> int -> char -> unit = "%string_safe_set" > external create : int -> string = "create_string" > val make : int -> char -> string > val copy : string -> string > > [...] > > val lowercase : string -> string > val capitalize : string -> string > val uncapitalize : string -> string > type t = string > val compare : t -> t -> int > end > The field `compare' is required but not provided > The field `t' is required but not provided > make[1]: *** [extString.cmo] Error 2 > #> > > my naive solution was to add > type t = string > let compare = compare in the extString.ml file. > > now it compiles with ocmal 3.06, but it complains with 3.07 because > there's a dup definition... I know it sounds silly, but are you sure you're using version 3.06? The reason I ask is that this problem would make perfect sense in 3.04, because the compare and t fields in the standard String library were not present in that version. Also, Debian isn't distributing 3.06 at the moment - stable is 3.04, testing and unstable are 3.07. At any rate, since you're using OCamlMakefile it's pretty easy to work round this, if you're willing to use a non-standard ExtLib. Add conditional compilation directives from your preprocessor of choice using some suitable conditional symbol around the definitions of t and compare in extString.ml, and a (*pp foo *) directive at the top of that file to invoke that preprocessor. Then write a simple configure script that tries to compile a test that depends on String.compare and sets PPFLAGS to define that symbol if it fails. HTH |
From: Pietro A. <Pie...@an...> - 2004-02-05 07:32:33
|
Actually, you are right... I do all my development using 3.07 and I was living under the wrong assumption that debian stable uses 3.06. tnx to point it out. p On Tue, Feb 03, 2004 at 09:35:40AM +0000, Peter Jolly wrote: > I know it sounds silly, but are you sure you're using version 3.06? The > reason I ask is that this problem would make perfect sense in 3.04, > because the compare and t fields in the standard String library were not > present in that version. Also, Debian isn't distributing 3.06 at the > moment - stable is 3.04, testing and unstable are 3.07. -- ++ It is not doing the thing we like to do, but liking the thing we have to do, that makes life blessed. -- Goethe ++ Please avoid sending me Word or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html |
From: Nicolas C. <war...@fr...> - 2004-02-03 08:43:13
|
> Hi all, > I want to distribute extlib with my project and to do so I added a > Makefile to it. When compiling it on debian unstable (ocaml 3.07) > everything it's ok. When I try to compile the same code, with the same > makefile and ocaml 3.06 (debian woody) I get a complain about extString: [...] > now it compiles with ocmal 3.06, but it complains with 3.07 because > there's a dup definition... > > is it a known problem ? attached there's the makefile (using > OCamlMakefile) and the META file that might be useful having in the > extlib distribution... I didn't know there was such a problem with 3.06. Looks like it was a bug fixed in 3.07, I'm not sure it can be avoid in a compatible way... If you really need to have 3.06 support , please try to ask on the main caml list. Regards, Nicolas Cannasse |