Reputation: 24851
I am learning one opensource project, the homepage is here: https://github.com/kevsmith/gen_nb_server , I found that the project structure is
src/
gen_nb_server.erl
priv/
example
src/
example.erl
when I am going into example folder and run "make", and run the example module by "example:start_link().", it can not find gen_nb_server module, I want to know how to call the module which does not be laid in the same folder ? thanks!
Upvotes: 1
Views: 329
Reputation: 2925
In addition to what butter71 mentioned.. you can load code while in the shell itself...
1> code:add_path("gen_nb_server/ebin").
you can also use code:add_patha
or code:add_pathz
to load the beam files at the beginning or end of path list..
Upvotes: 3
Reputation: 2723
You can use -pa (or -pz) to add the top-level ebin and priv/example/ebin directories to the front (or end) of your code path.
# erl -pa gen_nb_server/ebin -pa gen_nb_server/priv/example/ebin
[...]
1> example:start_link().
{ok,<0.33.0>}
Upvotes: 5