include vs include_lib

mats cronqvist masse@REDACTED
Wed Jul 22 16:12:41 CEST 2009

Peter Mechlenborg <peter.mechlenborg@REDACTED> writes:

> Hi
> I have found myself starting to always use '-include_lib()' instead of just
> '-include()', because it makes compilation easier - you don't need to
> specify include directories, and files become "self-contained" regarding
> compilation.
> Why do people use '-include()' instead of '-include_lib()'?  Am I missing
> something obvious here?

  iirc, include_lib("blah/include/foo.hrl"). only works if "blah/ebin"
  is in the load path (i.e. what code:get_path() gives you).

  this might or might not be a problem. it's obviously not a problem for
  OTP supplied headers.


More information about the erlang-questions mailing list