Take a look at this tutorial by Necroman.

You get that error message, most likely because you did not export the ret function, in the definition file.