Ok. Does anybody know how to use OCamlMakefile to have it do this? The commands already call ocamlfind before ocamlc; ocamlfind ocamlc ... is there before every compile command. Does ocamlfind only look in ~/.opam? All my dependencies are local... On Wed, Nov 19, 2014 at 12:00 PM, David Allsopp wrote: > Kenneth Adam Miller wrote: > > I have a library that I'm building against. > > An OCaml library, or a C library? (it's unclear from what you say later) > > > I only consume an interface from > > 2 specific directories; there are no other usages throughout my code. I > would > > like to be able to link against the library, and have the compiler admit > my > > code so long as it uses the interfaces of the other libraries correctly. > > Instead, I'm having to recursively specify all the dependencies of the > library > > I consume! > > > > I specify the location of my library with -ccopt -L location/to/it and > then > > -ccopt is used with C libraries - are you sure you're trying to do the > correct thing? > > > afterward, have the cma or the cmxa before I specify my source that is > being compiled. > > > > Should I statically link? What do I do to avoid the dependency hell? > > You are (probably) statically linking - it sounds like you're mixing > terminology. If you use an OCaml library foo.cmxa which depends on bar.cmxa > then you do have to specify bar.cmxa before linking foo.cmxa - that's not > dependency hell, it's just linking! There is a simple solution to this: > ocamlfind. It manages all of the linking instructions for you simply by > specifying the package that you need to be available. > > > David > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs