Search code examples
erlangerl

Erlang VM -s Argument is causing my program to fail


I have read the thread here: Erlang VM -s argument misbehaving and have been troubleshooting to no avail.

When I run the erlang vm without the -s flag, my function works:

bridge_sup:start_link().

   Bridge Supervisor Initializing
   [warning] ClientId is NULL!
   [warning] ClientId is NULL!
   Success
   Success

However, if I have the -s flag set, when my function goes on to call another function emqttc:start_link(...) it never returns:

Bridge Supervisor Initializing
   [warning] ClientId is NULL!
   [warning] ClientId is NULL!

I can verify that it is not just a print problem because the program I am connecting to receives no signal.

What could possibly be causing this in the Erlang VM? I have also tried using eval to the same effect. Here is the ./run code:

erl -pa ebin -pa deps/*/ebin

Thank you in advance!


Solution

  • I am using Erlang version 19.2. I am not sure if this is a bug in this version, or it is a requirement to start a program, but I added a .app.src file and added "-eval 'application:start(myprog)'" and the program will now start!

    Note that it did not start with -s, -eval, or any of that without the app.src file and without application:start