Problem executing a program

Ulf Wiger (AL/EAB) <>
Thu Aug 26 10:55:09 CEST 2004


I don't know exactly how ecc is built, but on my machine,
it works with erlc, but not with ecc.

The ecc compiler uses stand-alone erlang, which is built
using only (basically) erts, kernel & stdlib. The include_lib
directive assumes that the application refered to is in the
path. As erlc starts a normal erlang VM, it is able to find
all standard erlang applications, including megaco.

All this is conjecture (well, after peeking at ecc.erl et al.)
The gurus at the OTP team may step in and correct me.

Solution to the problem: don't use -include_lib for megaco,
but instead -include("megaco.hrl"), and then pass on a -I
option to ecc.


/Uffe

> -----Original Message-----
> From: 
> [mailto:]On Behalf Of Guillermo
> Fernandez Castellanos
> Sent: den 26 augusti 2004 04:43
> To: 
> Subject: Problem executing a program
> 
> 
> Hi,
> 
> I have been trying to test very easy programs with Erlang.
> I have made a standard installation of Erlang (configure
> --prefix=/home/myhome; make; make install) after reading the README
> 
> When I try to execute this program:
> 
> -module(hello).
> 
> -export([start/1]).
> 
> -include_lib("kernel/include/file.hrl").
> %%**HERE**
> 
> start(Args) ->
>      io:format("Hello world~nArgs=~p~n", [Args]),
>      erlang:halt().
> 
> $ ecc test.erl
> works just well.
> 
> But when I add in %%**HERE** the line:
> -include_lib("megaco/include/megaco.hrl").
> it just do not work anymore:
> $ecc test.erl
> ./test.erl:6: can't find include lib "megaco/include/megaco.hrl"
> 
> Actually I obtain the same message while trying to compile
> ~/lib/erlang/lib/megaco-2.1.3/examples/simple/megaco_simple_mgc.erl
> 
> $ecc megaco_simple_mgc.erl
> ./megaco_simple_mgc.erl:52: can't find include lib
> "megaco/include/megaco.hrl"
> ./megaco_simple_mgc.erl:53: can't find include lib
> "megaco/include/megaco_message_v1.hrl"
> ./megaco_simple_mgc.erl:120: undefined macro 'megaco_ip_port_text'
> ./megaco_simple_mgc.erl:134: record megaco_receive_handle undefined
> ./megaco_simple_mgc.erl:283: undefined macro 'megaco_not_implemented'
> ./megaco_simple_mgc.erl:312: undefined macro 
> 'megaco_root_termination_id'
> ./megaco_simple_mgc.erl:334: undefined macro 'megaco_not_implemented'
> ./megaco_simple_mgc.erl:76: function do_start/1 undefined
> ./megaco_simple_mgc.erl:39: function 
> handle_trans_long_request/3 undefined
> ./megaco_simple_mgc.erl:39: function handle_trans_request/3 undefined
> 
> Where come this error from? I could not find any reference 
> while googling...
> 
> Any link, hint would be most wellcome.
> 
> Thanks!
> 
> G
> 
> 



More information about the erlang-questions mailing list