Re: Trouble running the hello world application

[email protected] Thu, 13 Sep 2012 13:12:46 +0200
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
On 13.09.2012 09:16, Willi Schinmeyer wrote:
> Looking at some old code of mine, init() should be called 
> luaopen_init().
>
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. 
> Discussions
> will include endpoint security, mobile security and the latest in 
> malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> luabind-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/luabind-user

Nope, still doesn't work. I thought it doesn't matter what is the 
function called since the name of the function is passed to 
package.loadlib as the 2nd argument so it always knows what to call. And 
I also forgot to call the init (now luaopen_init) function so now it 
should look like this:

     2 local f = package.loadlib(path, "luaopen_init")
     3 f()

but since f is nil, as a result of not loading the library for some 
reason, it gives me this error:
$ lua test.lua
lua: test.lua:3: attempt to call local 'f' (a nil value)
stack traceback:
	test.lua:3: in main chunk
	[C]: ?

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/