Hi Andreas,
If I understood correctly, you ran into a quite common problem, which is
tedious to handle with caml. Indeed, if you link with camlimages, the
namespace is occupied with module names Bmp, Blend, Camlimages etc ... and
you can't use these names in your application. The usual workaround *for
the library developper* is to prefix module names with something, here it
should have been Camlimages_bmp, Camlimages_blend etc ... while in the
Camlimages modules you'd have definitions like
module Bmp = Camlimages_bmp
module Blender = Camlimages_blender
etc ...
To my knowledge you only have two choices:
- repackage camlimages with a less agressive namespace consumption (that
maybe complicated because of how camlimages adapts to available C libraries)
- rename your own modules (but I understand this is inconvenient due to the
size of your codebase).
Maybe someone here on the main list has a more satisfactory idea?
ph.
2012/2/1 Andreas Romeyke <andreas.romeyke <at> dzb.de>
> Hello,
>
> Am Mittwoch, den 01.02.2012, 14:57 +0100 schrieb Philippe Strauss:
>
> > sure, don't use :
> >
> > open Camlimages
> >
> > and call :
> >
> > Camlimages.write_jpeg
>
> The problem must have another reason. The interface for our color.ml
> will be searched in /usr/lib/ocaml/camlimages first, instead using them
> from local path.
>
> By compiling we got now:
>
> ocamlbuild.native -verbose 10 -ocamlrun ocamlrun.opt -ocamlc ocamlc.opt
> -ocamlopt ocamlopt.opt -j 4 -tags annot -tags thread -tags debug
> -no-links -cflags "-w Aez -I,+dynlink -I /usr/lib/ocaml/bolt -I +threads
> -I +lablgtk2 -I +extlib -I +pcre -I +netsys -I +netstring -I +json-wheel
> -I +num -I +nums -I +dynlink -I +sexplib -I +zip
> -I /usr/lib/ocaml/camlimages -I +xml-light -I +xmlrpc-light -I +equeue
> -I +netclient -I /home/andreas/projekte/leibniz/trunk/core/_build "
> -lflags "-I,+dynlink -I /usr/lib/ocaml/bolt -I +num -I +nums -I +dynlink
> -I +sexplib -I +threads -I +lablgtk2 -I +extlib -I +pcre -I +netsys -I
> +netstring -I +json-wheel -I +num -I +nums -I +dynlink -I +sexplib -I
> +zip -I /usr/lib/ocaml/camlimages -I +xml-light -I +xmlrpc-light -I
> +equeue -I +netclient
> -I /home/andreas/projekte/leibniz/trunk/core/_build " -libs
> "unix,pcre,bigarray,netsys_oothr,netsys,netstring,equeue,netclient,jsonwheel,str,dynlink,bolt,extLib,nums,sexplib,zip,camlimages_core,camlimages_all,xml-light,xmlrpc-light"
> -I helper -I io -I img -I preprocessing -I dictionary -I ocr -I glyphs -I
> bbox -I segment -I structure -I form -I composite -I pdf -I test -I
> examples -pp "camlp4o /usr/lib/ocaml/bolt/bolt_pp.cmo -logger
> 'leibnizcored.native' -level DEBUG -- -I /usr/lib/ocaml/sexplib -I
> /usr/lib/ocaml/type-conv pa_type_conv.cma pa_sexp_conv.cma pa_macro.cmo
> -DNEWSEXP" leibnizcored.native
> + ocamlopt.opt -c -w Aez -I +dynlink -I /usr/lib/ocaml/bolt -I +threads
> -I +lablgtk2 -I +extlib -I +pcre -I +netsys -I +netstring -I +json-wheel
> -I +num -I +nums -I +dynlink -I +sexplib -I +zip
> -I /usr/lib/ocaml/camlimages -I +xml-light -I +xmlrpc-light -I +equeue
> -I +netclient -I /home/andreas/projekte/leibniz/trunk/core/_build -g
> -annot -thread -pp 'camlp4o /usr/lib/ocaml/bolt/bolt_pp.cmo -logger
> '\''leibnizcored.native'\'' -level DEBUG -- -I /usr/lib/ocaml/sexplib
> -I /usr/lib/ocaml/type-conv pa_type_conv.cma pa_sexp_conv.cma
> pa_macro.cmo -DNEWSEXP' -I img -I bbox -I ocr -I examples -I io -I test
> -I dictionary -I structure -I segment -I preprocessing -I pdf -I
> composite -I helper -I glyphs -I form -o img/color.cmx img/color.ml
> File "img/color.ml", line 1, characters 0-1:
> Error: The implementation img/color.ml
> does not match the interface /usr/lib/ocaml/camlimages/color.cmi:
> The field `colormap_parse' is required but not provided
> The field `color_parse' is required but not provided
> The field `brightness' is required but not provided
> The field `minus' is required but not provided
> The field `plus' is required but not provided
> The field `rgb_square_distance' is required but not provided
> The field `cmyk' is required but not provided
> The field `Cmyk' is required but not provided
> The field `rgba' is required but not provided
> The field `Rgba' is required but not provided
> The field `rgb' is required but not provided
> The field `Rgb' is required but not provided
> The field `copy' is required but not provided
> The field `add_colors' is required but not provided
> The field `add_color' is required but not provided
> The field `find_exact' is required but not provided
> The field `size' is required but not provided
> The field `map' is required but not provided
> The field `Too_many_colors' is required but not provided
> Command exited with code 2.
>
> Any additional hints?
>
> Bye Andreas
>
> --
> Andreas Romeyke
> - Abteilung Blindenschrift -
> Deutsche Zentralbücherei für Blinde zu Leipzig (DZB)
> Gustav-Adolf-Straße 7, 04105 Leipzig
> Tel: +49 341 7113-..., Fax: +49 341 7113-125
> Internet: www.dzb.de
> E-Mail: andreas.romeyke <at> dzb.de
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> Archives up to December 31, 2010 are also downloadable at
> http://www.connettivo.net/cntprojects/ocaml_beginners
> The archives of the very official ocaml list (the seniors' one) can be
> found at http://caml.inria.fr
> Attachments are banned and you're asked to be polite, avoid flames
> etc.Yahoo! Groups Links
>
>
>
>
[Non-text portions of this message have been removed]