Re: Trouble findin a library which *is* installed

"Hendrik Boom [email protected] [ocaml_beginners]" <[email protected]>
Newsgroups gmane.comp.lang.ocaml.beginners
Message-ID <[email protected]>
On Fri, Jul 03, 2015 at 04:54:08PM -0400, Hendrik Boom [email protected] [ocaml_beginners] wrote:
> On Fri, Jul 03, 2015 at 09:47:47PM +0100, Jeremy Yallop [email protected] [ocaml_beginners] wrote:
> > On 3 July 2015 at 20:32, Hendrik Boom [email protected]
> > [ocaml_beginners] <[email protected]> wrote:
> > > I downloaded some code as an example of using Cairo with Gdk from the web page http://www.donadeo.net/post/2008/draw-something-on-the-screen-and-interact-with-it.
> > >
> > > I try to compile it:
> > >
> > > endrik@notlookedfor:~/dv/fun/group/toy/cairo_toy$ ocamlfind ocamlopt -package gdkEvent toy_maker.mli toy_maker.ml my_interactor.ml demo_toy.ml -o runme
> > > ocamlfind: Package `gdkEvent' not found
> > 
> > The module is called 'GdkEvent', but the package is called 'lablgtk2',
> > so you may need something more like this:
> > 
> >    ocamlfind ocamlopt -package lablgtk2 toy_maker.mli toy_maker.ml
> > my_interactor.ml demo_toy.ml -o runme
> 
> Thanks.
> 
> That gets me a lot further.  Now, of course, it's asking for the Cairo module.

Not that much better, it turns out.

When I tan the proposed command and it complained about Cairo, 
presumably having found lablgtk2, I had accidentally run as root.

But when I run as myself, it still can't find lablgtk2.

Now how could running as root affect the success or failure 
of the command?

Perhaps something to do with environment variables?  But when I su to 
root, I still have the same ones:

root@notlookedfor:/home/hendrik# env | grep caml -i
CAML_LD_LIBRARY_PATH=/home/hendrik/.opam/system/lib/stublibs:/usr/lib/ocaml/stublibs
OCAML_TOPLEVEL_PATH=/home/hendrik/.opam/system/lib/toplevel
root@notlookedfor:/home/hendrik# 

(If I log in as root directly from the system console, insted of via an 
xterm, I dont have these variables.  But that's not what I did.)

And root doesn't have an ~/.opam directory.  But why would an absence 
of a package library make it find things?

Oh... Maybe that's not what happened.  Maybe when I ran a myself it 
found Cairo somewhere withn .opam, and without .opam it complains about 
Cairo long before it gets around to looking for gdkEvent.

Maybe I should turf the Debian package for lablgtk and fetch it in 
through opam instead?

Any opinions?  I could go on and experiment and get something working, 
but I'd really like to understand what's going on instead of perhaps 
messing things up even worse.

-- hendrik

> 
> Is there a way to find the name of the package contiaining a 
> particular module without asking here all the time?
> 
> -- 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
> 
> 
>
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.