[erlang-questions] clueless newbie can't compile

Anthony Kong <>
Mon Jun 16 03:14:54 CEST 2008


Hi, 

I am wondering which platfrom you are using? Linux? If so, which
distribution?

The "c(xxx)." is basically a shorthand to some underlying erlang
modules. If you have a look at c.erl, c/1 is actually passing the
parameters to compile:file/2.

So, what is likely to have happen is you have a corrupted installation
of erlang, so erl runtime, for some reason cannot find the compile
module. Hence the "undef".

Try the basic first. Install erlang/otp via the standard package
management system of your OS and see if it improves. Then move on to try
CEAN.

Cheers, Anthony

-----Original Message-----
From: 
[mailto:] On Behalf Of John Chandler
Sent: Monday, 16 June 2008 10:47 AM
To: 
Subject: [erlang-questions] clueless newbie can't compile

I can't interpret the error message, either.

Two different tutorials advise creating a file and compiling it, which
seems like a reasonable way to start.  To take one, it advises me to
create a file, "tut.erl", containing the following:
====
-module(tut).
-export([double/1]).

double(X) ->
     2 * X.
====

And then, within erl, to type "c(tut).".  Which also seems fine.  What
happens is:

====
1> c(tut).
** exited: {undef,[{compile,file,[tut,[report_errors,report_warnings]]},
                    {c,c,2},
                    {erl_eval,do_apply,5},
                    {shell,exprs,6},
                    {shell,eval_loop,3}]} **

=ERROR REPORT==== 15-Jun-2008::20:07:51 === Error in process <0.29.0>
with exit value: {undef,[{compile,file,[tut,
[report_errors,report_warnings]]},{c,c,2},{erl_eval,do_apply,5},
{shell,exprs,6},{shell,eval_loop,3}]}

2>
====

OK, so what am I being told here?  Something is undefined, but it's not
clear to me what that thing is, or where it's supposed to be, much less
what I can do about it.  Can someone toss me a clue?

I'm using the CEAN package, and while I believe I followed the
instructions in the FAQ, I could have made a mistake somewhere.

I launched erl from the directory where tut.erl sits.  I had, per the
FAQ, set the BASEDIR to /usr/local/cean, so I thought maybe for some
unpleasant reason the file had to reside there, and copied it over, but
the same symptom resulted.

Thanks.

-jmc

_______________________________________________
erlang-questions mailing list

http://www.erlang.org/mailman/listinfo/erlang-questions

NOTICE
This e-mail and any attachments are confidential and may contain copyright material of Macquarie Group Limited or third parties. If you are not the intended recipient of this email you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. Macquarie Group Limited does not guarantee the integrity of any emails or any attached files. The views or opinions expressed are the author's own and may not reflect the views or opinions of Macquarie Group Limited.




More information about the erlang-questions mailing list