I have a project composed of several apps. The apps use some of the same records and functions to communicate, so I would like to make a module "shared" between them.
I tried using the code:add_path and code:load_file functions but the app still crashes with an undef error when trying to access those shared functions.
The apps are started using different escript methods (rebar3 shell and make run with erlang.mk).
{extra_src_dirs, []} option)?EDIT:
I also tried using code:load_abs and adding -pa <file_path> to vm.args
I succeeded by simply using code:load_abs("<file_path>.beam"), and having a symlink to the original .erl file with the other source code. According to the documentation the extension needs to be omitted, which threw me off.
EDIT: use a hardlink instead, for some reason my changes stop taking affect at some point between the files..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With