Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Ocamlmakefile and Lablgtk
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-11-12 (22:18)
From: Johann Spies <jhspies@a...>
Subject: Re: [Caml-list] Ocamlmakefile and Lablgtk
On Mon, Nov 12, 2001 at 06:59:39PM +0100, Markus Mottl wrote:
> > gtkInit.cmx as in 
> I assume the problem is that you haven't specified where to find
> libraries. Note that INCDIRS is only for interface files (.cmi), whereas
> LIBDIRS is necessary if there are libraries in the directory against
> which you want to link. Therefore, add this line:
>   LIBDIRS=+lablgtk

Thanks for the suggestion.  I have added this line, but it makes
no difference:
js-23:25:58-~/ocaml/lablgtk$make nc
make[1]: Entering directory `/home/js/ocaml/lablgtk'
ocamlopt -c  -labels -w s  -I +lablgtk
ocamlopt   -I +lablgtk      -ccopt -L+lablgtk  lablgtk.cmxa
unix.cmxa gtkInit.cmxa     -o calc \
Cannot find file gtkInit.cmxa
The problem is that it should use gtkInit.cmx.  There is no
gtkInit.cmxa (at least in thei Debian distribution). 

After your message I went back and read the documentation on the
compiler again.  I then tried to put
/usr/lib/ocaml/lablgtk/gtkInit.cmx on the SOURCES line and it
worked in some cases, but I suspect it is not the correct way to
do it.  I did not previously understand the difference between
.cmx and .cmxa files.  It becomes clearer now.

However the problem is not solved yet.

The following Makefile compiles (make nc) without complaints:

OCAMLMAKEFILE=/usr/share/ocaml-tools/OcamlMakefile /usr/lib/ocam/lablgtk/gtkInit.cmx
OCAMLFLAGS=-labels -w s

As I understand it, it should be the equivalent of 

ocamlopt.opt -w s -I +lablgtk -labels -o testgtk\
 lablgtk.cmxa gtkInit.cmx

 But the latter produces a binary which runs without a problem
 and the first (make nc) produces a binary of a different size
 with a lot of error messages.

J.H. Spies - Tel. 021-982 2694 / 082 782 0336 / 021-808 4036(w)  
             Posbus 4668, Tygervallei 7536
     "And we know that all things work together for good to 
      them that love God, to them who are the called  
      according to his purpose."            
                                   Romans 8:28 
Bug reports:  FAQ:
To unsubscribe, mail  Archives: