Manoj
Manoj

Reputation: 23

Exception Error, Erlang

This question is with reference to the question in the link:

"** exception error: undefined function add:addfunc/0 in Erlang "

I'm trying to execute a simple erlang program of adding two numbers. I'm trying to do this in Eclipse on Ubuntu 10.04 LTS.

When I execute this program, I'm getting the error as shown below:

 -module(add). 
    -export([addfunc/0]).

    addfunc() -> 
        6 + 5.

" ** exception error: undefined function add:addfunc/0 "

This program when executed in the erlang shell is working fine. But when it comes to eclipse it's giving me this error. Not this, any program for that matter is giving me the similar error. Guess I would be missing something about the eclipse configuration.

Upvotes: 0

Views: 340

Answers (1)

Cavet
Cavet

Reputation: 152

I haven't tested your code, but this very basic code should work.

The message says that your function does not exist. Make sure that you have no errors at compile time.

Check whether your function is exported with:

add:module_info().

the result should look alike this:

[{module,add},
 {exports,[{addfunc,0},
.....

Upvotes: 0

Related Questions