2017-01-29 12 views
0

지난 주에 정상적으로 작동했습니다. 나는Erlang 셸에서 내 모듈로드가 중지되었습니다.

cd myprojectdir erl (erlang shell). c(room). {ok, R} = room:go().

가 나는 내 방 모듈과 상호 작용, R에게 메시지를 보낼 gen_server 사용할 수있는 열 것입니다.

나는 카우보이 라우팅 지점에서 시작했습니다. 일이 잘 작동하는 것을보고 있었는데, 오늘 그것을 보았을 때 컴파일 오류가 발생했습니다. 그래서 나는 내 주점으로 되돌아 갔다. 쉘에서 여전히 오류가 발생하고 심지어 커밋 몇 개를 롤백합니다.

room : go()를 호출하려고하면 다른 모듈은 undef으로 인쇄됩니다. 교대로 각각 컴파일하면 room()이 작동합니다.

방은 테이블을 걷어차 고, 테이블은 시계, 좌석 및 게임을 시작하고 게임은 보드 및 액션에서 시작합니다.

https://github.com/quantumproductions/tunnel

2> c(game). 
{ok,game} 
3> game:go(). 
** exception exit: undef 
    in function board:go/0 
     called as board:go() 
    in call from game:init/1 (game.erl, line 57) 
    in call from gen_server:init_it/6 (gen_server.erl, line 328) 
    in call from proc_lib:init_p_do_apply/3 (proc_lib.erl, line 247) 
4> c(board). 
{ok,board} 
5> game:go(). 
** exception exit: undef 
    in function actions:go/0 
     called as actions:go() 
    in call from game:init/1 (game.erl, line 58) 
    in call from gen_server:init_it/6 (gen_server.erl, line 328) 
    in call from proc_lib:init_p_do_apply/3 (proc_lib.erl, line 247) 
6> c(actions). 
{ok,actions} 
7> actions:go(). 
{ok,<0.93.0>} 
8> game:go(). 
{ok,<0.95.0>} 
9> c(room). 
{ok,room} 
10> room:go(). 
** exception exit: undef 
    in function table:go/0 
     called as table:go() 
    in call from room:tablePids/2 (room.erl, line 33) 
    in call from room:init/1 (room.erl, line 80) 
    in call from gen_server:init_it/6 (gen_server.erl, line 328) 
    in call from proc_lib:init_p_do_apply/3 (proc_lib.erl, line 247) 
11> c(table). 
{ok,table} 
12> room:go(). 
** exception exit: undef 
    in function clock:go/0 
     called as clock:go() 
    in call from table:init/1 (table.erl, line 7) 
    in call from gen_server:init_it/6 (gen_server.erl, line 328) 
    in call from proc_lib:init_p_do_apply/3 (proc_lib.erl, line 247) 
13> c(clock). 
{ok,clock} 
14> room:go(). 
** exception exit: undef 
    in function seats:go/0 
     called as seats:go() 
    in call from table:init/1 (table.erl, line 8) 
    in call from gen_server:init_it/6 (gen_server.erl, line 328) 
    in call from proc_lib:init_p_do_apply/3 (proc_lib.erl, line 247) 
15> c(seats). 
{ok,seats} 
16> room:go(). 
** exception exit: undef 
    in function hall:go/0 
     called as hall:go() 
    in call from room:init/1 (room.erl, line 81) 
    in call from gen_server:init_it/6 (gen_server.erl, line 328) 
    in call from proc_lib:init_p_do_apply/3 (proc_lib.erl, line 247) 
17> c(hall). 
{ok,hall} 
18> room:go(). 
{ok,<0.159.0>} 
19> 
=ERROR REPORT==== 29-Jan-2017::17:37:45 === 
Error in process <0.169.0> with exit value: 
{undef,[{s,s,[<0.159.0>,update],[]}]} 

=ERROR REPORT==== 29-Jan-2017::17:37:46 === 
Error in process <0.170.0> with exit value: 
{undef,[{s,s,[<0.159.0>,update],[]}]} 

=ERROR REPORT==== 29-Jan-2017::17:37:47 === 
Error in process <0.171.0> with exit value: 
{undef,[{s,s,[<0.159.0>,update],[]}]} 

=ERROR REPORT==== 29-Jan-2017::17:37:48 === 
Error in process <0.172.0> with exit value: 
{undef,[{s,s,[<0.159.0>,update],[]}]} 

=ERROR REPORT==== 29-Jan-2017::17:37:49 === 
Error in process <0.173.0> with exit value: 
{undef,[{s,s,[<0.159.0>,update],[]}]} 

=ERROR REPORT==== 29-Jan-2017::17:37:50 === 
Error in process <0.174.0> with exit value: 
{undef,[{s,s,[<0.159.0>,update],[]}]} 

각 이동() 함수는

go() -> 
    gen_server:start_link(?MODULE, [], []). 

버전에 대한 단지 편의 : 무슨 일

Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] 

Eshell V8.2 (abort with ^G) 

?

편집 :

의 :의 내 바로 가기 모듈

-module(s). 
-export([s/2]). 
% Shortcuts. 

% Send 
s(Pid, Message) -> 
    gen_server:call(Pid, Message). 

업데이트 메시지가 테이블의 각 업데이트를 보내려고 시도 객실에서 타이머에 전송에서입니다.

는 편집 :

나는 ZERO 코드를 변경했습니다. 내가 지금 실행할 때 일어나는 일은 .. 벌써 * .beam 파일을 가지고 있기 때문이야?

=ERROR REPORT==== 29-Jan-2017::17:50:19 === 
Error in process <0.200.0> with exit value: 
{undef,[{s,s,[<0.59.0>,update],[]}]} 

BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded 
     (v)ersion (k)ill (D)b-tables (d)istribution 
^C~/tunnel:.ls 
actions.beam clock.beam hall.beam s.erl  table.erl 
actions.erl clock.erl hall.erl seats.beam timer.erl 
board.beam game.beam room.beam seats.erl 
board.erl game.erl room.erl table.beam 
~/tunnel:.erl 
Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] 

Eshell V8.2 (abort with ^G) 
1> c(board). 
{ok,board} 
2> c(all). 
all.erl: no such file or directory 
error 
3> c(). 
** exception error: undefined shell command c/0 
4> c(room). 
{ok,room} 
5> c(s). 
{ok,s} 
6> room:go(). 
{ok,<0.96.0>} 
7> 
BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded 
     (v)ersion (k)ill (D)b-tables (d)istribution 
^C~/tunnel:.erl 
Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] 

Eshell V8.2 (abort with ^G) 
1> c(room). 
{ok,room} 
2> room:go(). 
{ok,<0.72.0>} 
3> room:test(). 
    All 4 tests passed. 
ok 
4> 
BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded 
     (v)ersion (k)ill (D)b-tables (d)istribution 
^C~/tunnel:. 
~/tunnel:.erl 
Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] 

Eshell V8.2 (abort with ^G) 
1> c(room). 
{ok,room} 
2> room:go(). 
{ok,<0.72.0>} 
3> room:test(). 
    All 4 tests passed. 
ok 
4> 

답변

1

그것은 특히 우리는 코드가 작동하는 곳에 당신이 당신의 편집에서 컴파일 할 볼 수 있습니다주고, 첫 번째 경우에 컴파일되지 않은 모듈 s처럼 나에게 소리.

=ERROR REPORT==== 29-Jan-2017::17:37:50 === 
Error in process <0.174.0> with exit value: 
{undef,[{s,s,[<0.159.0>,update],[]}]} 

오류는 호출이 인수 <0.159.0>updates과 기능 s이 미확정에 실패 모듈을 말하고있다.

얼랭 (Erlang)은 아직 정의되지 않은 함수를 호출하는 모듈을 컴파일하게합니다. 따라서 우리는 tools like xref을 가지고 있습니다.

mix, rebar3 또는 erlang.mk과 같은 적절한 빌드 도구를 사용하지 않는 경우 알려 주시기 바랍니다.