2

I am new to rebar and erlang in general and read that we can use other modules by specifying them as deps in rebar.config file. I am able to compile them properly but not sure how to use them in my module. If I try to use them, I get an error that the function is not available.

How can I use the functions from the modules that are in deps in my modules.

Thanks!

2 Answers2

2

You have to tell code server where to find compiled code. I usually have in MakeFile something like:

run:
    erl -pa ebin -pa deps/*/ebin
Hynek -Pichi- Vychodil
  • 26,174
  • 5
  • 52
  • 73
  • Thanks Hynek, but, if I am not wrong, this is after I have the whole application working. I would like to use the modules in deps in my module that I am currently building to make it an application. I am in the process of writing and would like to use them. Thanks –  Apr 18 '16 at 04:40
  • @SrinathKattula No, this is for modify/run/test cycle. In contrary for whole application/release you don't need this because release generator will do it for you. – Hynek -Pichi- Vychodil Apr 18 '16 at 04:43
1

You usually need to specify application:start(appname) or similar in your application file before using them (to get some application to start up) and try to define them in the app.src file also, after that you should be able to use them

Soniku
  • 154
  • 1
  • 5