[erlang-questions] incude_lib question

ttmrichter <>
Mon Jun 29 15:17:08 CEST 2009


Too bad the documentation isn't searchable and is painfully badly indexed,  
eh Peter?

To be more helpful, bokner:

The first link you need to read is  
http://www.erlang.org/doc/reference_manual/macros.html#7.1. This references  
the function code:lib_dir(). Hitting the function index nets us  
http://www.erlang.org/doc/man/code.html#lib_dir-1 for that function. This  
gives us the explanation that the application must be "located under  
$OTPROOT/lib or on a directory referred to via the ERL_LIBS environment  
variable".

Now further explanation in that same function tells us that the application  
must be "a regular directory called Name or Name-Vsn in the code path with  
an ebin subdirectory". So one possibility is that your application doesn't  
have an ebin subdirectory. If it doesn't, code:lib_dir() won't find it I'm  
wagering. Since I can't see your setup I can't really guess for certain.

In case this isn't the cause, let's take a look at  
http://www.erlang.org/doc/design_principles/part_frame.html to see if  
there's any clues. There's a whole section on "included applications" so  
that looks like it might be a clue there. My eye is drawn toward  
http://www.erlang.org/doc/design_principles/included_applications.html#8.2  
where it points out the "included_applications" key in the .app file.  
Double check that you're actually including the application there, perhaps?

(Looking in the Armstrong book I'm not seeing anything there that's  
particularly helpful in answering your question so I think the "any erlang  
book" isn't exactly a helpful comment either since there's at least one  
that doesn't.)

On Jun 29, 2009 8:39pm, Peter Lund <> wrote:
> Try R13A doc: OTP/doc/R13A/erts-5.7/doc/html/index.html or any erlang  
> book.



> bokner skrev:


> Why include_lib works with application names for some applications and

> doesn't for others? For example, I have exmpp application installed in

> my Erlang lib directory, and include_lib doesn't see headers when I

> do:



> include_lib("exmpp/include/some_header.hrl"),



> while it works for crypto, mnesia, kernel apps etc.?



> There must be some packaging option that affects this, but I couldn't

> find it. Thank you for help.



> ________________________________________________________________

> erlang-questions mailing list. See http://www.erlang.org/faq.html

> erlang-questions (at) erlang.org










> ________________________________________________________________

> erlang-questions mailing list. See http://www.erlang.org/faq.html

> erlang-questions (at) erlang.org





More information about the erlang-questions mailing list