My system is 3.11.0-24-generic #41-Ubuntu SMP Mon Jun 9 20:36:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
I successfully installed camlimages.
Then I took the example:
let () =
let img = Rgb24.create 1 1 in
Rgb24.set img 0 0 { Color.r = 255; g = 0; b = 0 };
Jpeg.save "sample.jpg" [] (Images.Rgb24 img)
Then I used
ocamlbuild -use-ocamlfind -package camlimages -package camlimages.jpeg test.native
to compile and it was successful as well.
finally, when I tried to run ./test.native
, it says
Fatal error: exception Failure("unsupported")
Why? How to fix?
By the way, after I used opam install, it didn't give any error but if I try to -package camlimages.all
, then it says I don't have camlimages.freetype
, why?
I did ocamlfind list | grep camlimages
, it shows:
camlimages (version: 4.1.1)
camlimages.all (version: 4.1.1)
camlimages.all_formats (version: 4.1.1)
camlimages.core (version: 4.1.1)
camlimages.exif (version: 4.1.1)
camlimages.gif (version: 4.1.1)
camlimages.graphics (version: 4.1.1)
camlimages.jpeg (version: 4.1.1)
camlimages.png (version: 4.1.1)
camlimages.ps (version: 4.1.1)
camlimages.tiff (version: 4.1.1)
camlimages.xpm (version: 4.1.1)
After turn on the debug, now it shows
Raised by primitive operation at file "jpeg.ml", line 152, characters 6-308
Called from file "test.ml", line 5, characters 2-46
ocamlbuild -use-ocamlfind -package camlimages -package camlimages.jpeg -cflag -g test.byte
and when run with OCAMLRUNPARAM=b, it says(Cannot print stack backtrace: program not linked with -g)
Could you verify that this (from my comment) works?, stackoverflow.com/questions/612886/…
what do you mean?opam
to install it and opam listed camlimages package