caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] OCamlMake and cmo files
@ 2003-11-27  9:33 Flavio
  2003-11-27 12:14 ` Markus Mottl
  0 siblings, 1 reply; 4+ messages in thread
From: Flavio @ 2003-11-27  9:33 UTC (permalink / raw)
  To: caml-list

Hello all,
Sorry if this is obvious, but I tried on the beginners list with no 
luck, so...

I'm trying to use OCamlMake from Markus Mottl but don't know what to do 
with .cmo files.
My Makefile is: (file editor2.ml is the example from lablgtk2 package)

OCAMLMAKEFILE = /usr/share/ocaml-tools/OCamlMakefile

SOURCES = editor2.ml
RESULT  = editor2
INCDIRS = +lablgtk2
LIBS = lablgtk gtkInit

include $(OCAMLMAKEFILE)

and the error is 
ocamlc  -I +lablgtk2 lablgtk.cma gtkInit.cma -o editor editor.cmo
Cannot find file gtkInit.cma

Right, the file is gtkInit.cmo but if i add the extension to the 
filename it tells: Cannot find file gtkInit.cmo.cma

Am I missing something obvious?

Flavio

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] OCamlMake and cmo files
  2003-11-27  9:33 [Caml-list] OCamlMake and cmo files Flavio
@ 2003-11-27 12:14 ` Markus Mottl
  2003-11-27 22:13   ` Flavio
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Mottl @ 2003-11-27 12:14 UTC (permalink / raw)
  To: Flavio; +Cc: caml-list

On Thu, 27 Nov 2003, Flavio wrote:
> and the error is 
> ocamlc  -I +lablgtk2 lablgtk.cma gtkInit.cma -o editor editor.cmo
> Cannot find file gtkInit.cma
> 
> Right, the file is gtkInit.cmo but if i add the extension to the 
> filename it tells: Cannot find file gtkInit.cmo.cma

There is a good reason why this is handled this way: the extension
differs for byte- and native code libraries.

If you want to link anything that is only available in byte code (or
pass special flags to the byte code linker), just use the variable
OCAMLBLDFLAGS (see README in the distribution for details). Everything
you put in there will be passed verbatim in the linking stage.

Regards,
Markus Mottl

-- 
Markus Mottl          http://www.oefai.at/~markus          markus@oefai.at

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] OCamlMake and cmo files
  2003-11-27 12:14 ` Markus Mottl
@ 2003-11-27 22:13   ` Flavio
  2003-11-27 23:01     ` Markus Mottl
  0 siblings, 1 reply; 4+ messages in thread
From: Flavio @ 2003-11-27 22:13 UTC (permalink / raw)
  To: caml-list

Alle 13:14, giovedì 27 novembre 2003, Markus Mottl ha scritto:

> If you want to link anything that is only available in byte code (or
> pass special flags to the byte code linker), just use the variable
> OCAMLBLDFLAGS (see README in the distribution for details).
> Everything you put in there will be passed verbatim in the linking
> stage.

Now my Makefile is:

OCAMLMAKEFILE = /usr/share/ocaml-tools/OCamlMakefile

SOURCES = editor2.ml
RESULT  = editor2
INCDIRS = +lablgtk2
LIBS = lablgtk

OCAMLBLDFLAGS = gtkInit.cmo

but this executes
ocamlc -I +lablgtk2 gtkInit.cmo lablgtk.cma -o editor2 editor2.cmo

that gives an error because the right order is (lablgtk.cma first):
ocamlc -I +lablgtk2 lablgtk.cma gtkInit.cmo -o editor2 editor2.cmo

And now?

Many thanks for your help (and patience)

> Regards,
> Markus Mottl

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] OCamlMake and cmo files
  2003-11-27 22:13   ` Flavio
@ 2003-11-27 23:01     ` Markus Mottl
  0 siblings, 0 replies; 4+ messages in thread
From: Markus Mottl @ 2003-11-27 23:01 UTC (permalink / raw)
  To: Flavio; +Cc: caml-list

On Thu, 27 Nov 2003, Flavio wrote:
> Now my Makefile is:
> 
> OCAMLMAKEFILE = /usr/share/ocaml-tools/OCamlMakefile
> 
> SOURCES = editor2.ml
> RESULT  = editor2
> INCDIRS = +lablgtk2
> LIBS = lablgtk
> 
> OCAMLBLDFLAGS = gtkInit.cmo
> 
> but this executes
> ocamlc -I +lablgtk2 gtkInit.cmo lablgtk.cma -o editor2 editor2.cmo
> 
> that gives an error because the right order is (lablgtk.cma first):
> ocamlc -I +lablgtk2 lablgtk.cma gtkInit.cmo -o editor2 editor2.cmo

Well, that's easy ;-)

How about

  OCAMLBLDFLAGS = lablgtk.cma gktInit.cmo

and dropping "LIBS = lablgtk"?

Regards,
Markus Mottl

--
Markus Mottl          http://www.oefai.at/~markus          markus@oefai.at

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-11-27 23:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-27  9:33 [Caml-list] OCamlMake and cmo files Flavio
2003-11-27 12:14 ` Markus Mottl
2003-11-27 22:13   ` Flavio
2003-11-27 23:01     ` Markus Mottl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).