Erlang应用问题

Erlang应用问题,erlang,otp,Erlang,Otp,我尝试将应用程序写入我的Erlang程序 我有test_app.erl: -module(test_app). -behaviour(application). %% Application callbacks -export([start/2, stop/1]). start(_Type, _StartArgs) -> test_sup:start_link(). stop(_State) -> ok. 和.app文件: {application, test,

我尝试将应用程序写入我的Erlang程序

我有test_app.erl:

-module(test_app).

-behaviour(application).

%% Application callbacks
-export([start/2, stop/1]).

start(_Type, _StartArgs) ->
    test_sup:start_link().

stop(_State) ->
  ok.
和.app文件:

{application, test,
  [{description, "test system."},
  {vsn, "1.0"},
  {modules, [test_app, test_sup, fsm]},
  {registered, [test_sup, fsm]},
  {applications, [kernel, stdlib]},
  {mod, {test_app, []}}
]}.
当我尝试启动应用程序时:

application:start(test).
我得到一个错误:

=INFO REPORT==== 18-Feb-2011::19:38:53 ===
    application: test
    exited: {bad_return,
                {{test_app,start,[normal,[]]},
                 {'EXIT',
                     {undef,
                         [{test_sup,start_link,[[]]},
                          {test_app,start,2},
                          {application_master,start_it_old,4}]}}}}
    type: temporary
{error,{bad_return,{{test_app,start,[normal,[]]},
                    {'EXIT',{undef,[{test_sup,start_link,[[]]},
                                    {test_app,start,2},
                                    {application_master,start_it_old,4}]}}}}}
怎么了?我怎样才能修好它

如果我在eshell制作:

test_app:start(normal, []).
比一切都好


谢谢。

我想这可能是由于没有加载[property].梁造成的。确保所有模块都在同一目录中,或尝试使用
-pa
键,例如。g、 :


它告诉你函数
test\u-sup:start\u-link([])
不存在(
{test\u-sup,start\u-link,[[[]]}
),但是你在给我们的代码中用
test\u-sup:start\u-link()
调用它。此外,您的.app文件显示,当您的应用程序明显以
test\u app
开头时,应该调用模块
epmail\u app
。是否有你没有正确发布的东西,或者我只是在想象?如果是这样的话,Yasir关于返回值的回答是正确的。此外,查看supervisor
test\u sup
的代码可能很方便。我认为supervisor代码很好,因为如果我尝试手动运行supervisor,一切正常。您重新编译了所有模块吗?
$ erl -pa ../ebin
1> application:start(test).
...