Quest for ml_gdk_cairo_create

"Hendrik Boom [email protected] [ocaml_beginners]" <[email protected]>
Newsgroups gmane.comp.lang.ocaml.beginners
Message-ID <[email protected]>
I finally found where ml_gdk_cairo_create is defined.  Its definition
was cunningly hidden from Google search by token-pasting.

Within cairo.1.2.0/src/ml_cairo_lablgtk.c, in the source code I obtained
from opam source, there is the line

wML_1(gdk_cairo_create, GdkDrawable_val, Val_cairo_t)

wML_1 is defined in cairo.1.2.0/src/ml_cairo_wrappers.h, and
token-pastes "ml_" onto the start of "gdk_cairo_create"
to produce ml_gdk_cairo_create

What remains to be explained is why the compiled code doesn't seem to
end up in opam's cairo library.

Any ideas?

-- hendrik

On Sat, Jul 11, 2015 at 10:48:37PM -0400, Hendrik Boom [email protected] [ocaml_beginners] wrote:
> On Sun, Jul 12, 2015 at 08:07:04AM +0900, Gabriel Scherer [email protected] [ocaml_beginners] wrote:
> > When building an executable you should pass the flag -linkpkg to ocamlfind.
> 
> Yes, that helps a lot.  Thanks.  I'm left with one undefined symbol:
> 
> hendrik@notlookedfor:~/dv/fun/group/toy/cairo_toy$ ocamlfind ocamlopt -package cairo -package lablgtk2 -linkpkg toy_maker.mli toy_maker.ml my_interactor.ml demo_toy.ml -o runme
> toy_maker.o: In function `camlToy_maker__redraw_1030':
> (.text+0x102): undefined reference to `ml_gdk_cairo_create'
> collect2: error: ld returned 1 exit status
> File "caml_startup", line 1:
> Error: Error during linking
> hendrik@notlookedfor:~/dv/fun/group/toy/cairo_toy$ 
> 
> 
> Now presumably this is the symbol referenced in cairo_lablgtk.ml:
> 
> external create           : [> `drawable] Gobject.obj -> Cairo.t = "ml_gdk_cairo_create"
> 
> and I'd guess there should be C code around somewhere interfacing this module to 
> the actual gdk or cairo libraries.  And a shared or unshared binary library 
> somewhere defining it.  But a google search didn't find it, and 
> presumably there's some proper way to track it down.
> 
> -- hendrik
> 
> > 
> > On Sun, Jul 12, 2015 at 7:54 AM, Hendrik Boom [email protected]
> > [ocaml_beginners] <[email protected]> wrote:
> > 
> > > On Sat, Jul 04, 2015 at 10:29:22AM -0400, Hendrik Boom
> > > [email protected] [ocaml_beginners] wrote:
> > > > On Sat, Jul 04, 2015 at 06:19:02AM +0000, Gage Peterson
> > > [email protected] [ocaml_beginners] wrote:
> > > > > Use opam. It will work out much better. Also I don't think you should
> > > ever
> > > > > have to run it from root.
> > > >
> > > > Running it from root was a mistake.  And the way it affected the
> > > > results was a clue that the Debian-installed packages weren't even
> > > > being seen.  THough first I misinterpreted the clue.
> > > >
> > > > I'll try opam.  That should work.
> > > >
> > > > Will report back.
> > >
> > > OK.  Did
> > >    opam install lablgtk
> > > and
> > >    opam install cairo
> > >
> > > Now I get
> > >
> > > hendrik@notlookedfor:~/dv/fun/group/toy/cairo_toy$ ocamlfind ocamlopt
> > > -package cairo -package lablgtk2 toy_maker.mli toy_maker.ml
> > > my_interactor.ml demo_toy.ml -o runme
> > > File "demo_toy.ml", line 1:
> > > Error: No implementations provided for the following modules:
> > >          GMain referenced from toy_maker.cmx, my_interactor.cmx
> > >          GPack referenced from toy_maker.cmx
> > >          GWindow referenced from toy_maker.cmx
> > >          GBin referenced from toy_maker.cmx
> > >          Cairo referenced from my_interactor.cmx
> > >          GMisc referenced from toy_maker.cmx
> > > hendrik@notlookedfor:~/dv/fun/group/toy/cairo_toy$
> > >
> > >
> > > Can I conclude that I'm now getting as far as the linker?
> > >
> > > How do I go abbout getting it to actually *find* these modules?
> > >
> > > -- hendrik
> > >
> > >
> > > ------------------------------------
> > > Posted by: Hendrik Boom <[email protected]>
> > > ------------------------------------
> > >
> > > Archives up to December 31, 2011 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
> > >
> > >
> > >
> > >
> 
> 
> ------------------------------------
> Posted by: Hendrik Boom <[email protected]>
> ------------------------------------
> 
> Archives up to December 31, 2011 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
> 
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.