Problem executing a program

Guillermo Fernandez Castellanos <>
Fri Aug 27 04:20:46 CEST 2004


>> 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"
Hi,

Thanks everybody for your answers.

In the mean time, I keeped reading, and I finded another way of compiling:
$ erl
Erlang (BEAM) emulator version 5.3

Eshell V5.3.6.3  (abort with ^G)
1> c(test).
{ok,test}
2>

It even works with Erlang:
$ erl
Erlang (BEAM) emulator version 5.3.6.3 [source] [hipe]

Eshell V5.3.6.3  (abort with ^G)
1> c(megaco_simple_mgc).
./megaco_simple_mgc.erl:30: Warning: behaviour megaco_user undefined
{ok,megaco_simple_mgc}
2>

Is this the standard way of running programs with Erlang? Or should I 
use erlc instead?

> since this could be 2 very different kinds of errors it would be nice if 
> you could tell me if the file "megaco/include/megaco.hrl" exists on your 
> system.
erlang/lib/megaco-2.1.3/include/megaco.hrl
Yes, I have it it my system.

 > I don't know exactly how ecc is built, but on my machine,
 > it works with erlc, but not with ecc.
Indeed... I made the test and it works also for me with erlc.

I'll retry adding megaco to the path.

Thanks again!

G



More information about the erlang-questions mailing list