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
Linking order with Ocamlbuild
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-07-11 (07:46)
From: ygrek <ygrekheretix@g...>
Subject: Re: [Caml-list] Linking order with Ocamlbuild
On Tue, 7 Jul 2009 09:11:23 -0700 (PDT)
Dario Teixeira <> wrote:

> <**/main.native>: pkg_a, pkg_b, pkg_c
> <**/*.ml>: pkg_b, pkg_c
> Which is neither particularly pretty nor actually working.  Namely, during
> the linking stage, ocamlbuild is invoking "-package b -package a".  This is
> in the wrong order, and different from the one I specified.  Is there any
> straightforward way to fix it?
As far as I observed ocamlbuild preserves the same order of libraries at the linking stage
that was used when introducing those libraries in (namely with ocaml_lib).
So try to sort the output of find_packages as you need.