Chris00 / ocaml-cairo

Binding to Cairo, a 2D Vector Graphics Library.
GNU Lesser General Public License v3.0
54 stars 8 forks source link

cairo compilation messed up with opam prefix "4.03.0+flambda" #7

Closed william3 closed 8 years ago

william3 commented 8 years ago

Hello

compilation of cairo fails with opam switch 4.03.0+flambda. Cairo/autoconf looks for lablgtk2 directory, which is in my case /home/src/Ocaml/opam-ocaml-4.03.0/4.03.0+flambda/lib/lablgtk2/. The problem seems to be the "+" (that comes from opam switch name), which seems to be translated to some other standard path name :

ocamlc.opt -ccopt "-g -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/home/src/Ocaml/opam-ocaml-4.03.0/4.03.0/home/src/Ocaml/opam-ocaml-4.03.0/4.03.0+flambda/lib/ocaml/flambda/lib/lablgtk2/" ml_cairo_lablgtk.c ml_cairo_lablgtk.c:14:22: fatal error: wrappers.h: Aucun fichier ou dossier de ce type

include "wrappers.h"

Best regards

william3 commented 8 years ago

a first workaround would be to use something like this (not tried yet) : opam switch 4.03.0-flambda --alias-of 4.03.0+flambda

dbuenzli commented 8 years ago

/home/src/Ocaml/opam-ocaml-4.03.0/4.03.0/home/src/Ocaml/opam-ocaml-4.03.0/4.03.0+flambda/lib/ocaml/flambda/lib/lablgtk2/

I don't know what is responsible for that expansion but it looks like the + is expanded the way -I +bla expands to the bla directory of the compiler's lib directory when you use the OCaml compilers.

Chris00 commented 8 years ago

@william3 Are you sure you are not talking about the cairo OPAM package. The Cairo library developed here is distributed as cairo2 in opam and compiles fine with the latest version of OCaml.

william3 commented 8 years ago

yes, you are right, sorry for this.

Chris00 commented 8 years ago

@william3 No problem. No sure what you want to do with them but may I suggest you have a look to these Cairo bindings and possibly envision to use them? :-)