Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Lua ➜ luanet

luanet

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Anaristos   USA  (24 posts)  Bio
Date Sat 26 Jan 2013 07:26 AM (UTC)
Message

require("CLRPackage")

Fails with the following error:
error loading module 'luanet' from file '.\luanet.dll': The specified procedure could not be found.
--
I understand what the error means from the documentation, I just don't see how it applies. I use in both the Lua command line app and in other applications that allow Lua scripting with no problem.
I have to assume from this that things like:
import "System"
will fail for the same reasons. Is there a way around this?

Sic itur ad astra
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 26 Jan 2013 08:41 AM (UTC)
Message
I'm not familiar with CLRPackage.

However some of the ways that Lua DLLs work together can be problematic.

From my documentation:

Quote:

The error might be "The specified procedure could not be found." if the function is not found in the DLL. You may also get this message if the DLL is dependant on another DLL and some entry points in that other DLL cannot be found. Use a "dependency checker" to see whether all required entry points have been resolved. If you are certain that the entry point that you are requesting exists in the target DLL, then the problem is probably a dependency from the target DLL to another DLL.


You would need a dependency-checker to see what DLLs your DLL relies on. I presume there would be some, and it can be as simple as it depending on lua51.dll but you have lua5.1.dll.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Anaristos   USA  (24 posts)  Bio
Date Reply #2 on Sun 27 Jan 2013 01:59 AM (UTC)
Message
I think the problem lies with the package.path. Nowhere it points to lua's clib or even contains \?.dll, so putting the modules in the MUSH folder doesn't work. I tried

module.path = "..."

during the world open event, but either this is not the way to override the default path or the default path cannot be overriden.

Sic itur ad astra
Top

Posted by Anaristos   USA  (24 posts)  Bio
Date Reply #3 on Sun 27 Jan 2013 02:01 AM (UTC)
Message
Sorry, I typed the code in error, it should be:

package.path = "..."

Sic itur ad astra
Top

Posted by Anaristos   USA  (24 posts)  Bio
Date Reply #4 on Mon 28 Jan 2013 06:27 AM (UTC)
Message
I suppose I didn't state my question correctly. What I want to know is how I can modify the package.path so that modules are accessible to my scripts. Putting dlls in the MUSHClient folder doesn't do any good, AFAIK, because searching for \?.dll is not handled. The package.path only allows for \?.lua or \?.luac searches. I tried changing it so that \?.dll could be picked up and those entries were deleted by the client. Entries which I added that were \?.lua remained, however.

Sic itur ad astra
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #5 on Mon 28 Jan 2013 08:40 AM (UTC)
Message
There is a checkbox in the Lua tab of global configuration: "Allow DLLS to be loaded".

What state is that in?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Anaristos   USA  (24 posts)  Bio
Date Reply #6 on Wed 30 Jan 2013 01:15 AM (UTC)
Message
The box labeled Allow DLLs to be loaded is checked.

Sic itur ad astra
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #7 on Wed 30 Jan 2013 08:31 AM (UTC)
Message
Anaristos said:

I tried changing it so that \?.dll could be picked up and those entries were deleted by the client. Entries which I added that were \?.lua remained, however.


As far as I know, the client does not delete such entries.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Anaristos   USA  (24 posts)  Bio
Date Reply #8 on Wed 30 Jan 2013 10:19 AM (UTC)
Message
When I type print(package.path), the string that shows was put there by an unknown (to me) agent. I didn't even know I had access to the string until I started investigating why my require() requests were failing. When I try to load package.path with the string that I have stored in LUA_CPATH, it ignores it. Further, the string that shows by default contains no \?.dll references at all. I really don't care what the default string is as long as I can change it to suit me. It seems, however, that I cannot.

Sic itur ad astra
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #9 on Wed 30 Jan 2013 10:03 PM (UTC)
Message
What string exactly? When I do this:


print (package.cpath)


I get:


.\?.dll;C:\Program Files\MUSHclient\?.dll;C:\Program Files\MUSHclient\loadall.dll

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Anaristos   USA  (24 posts)  Bio
Date Reply #10 on Thu 31 Jan 2013 01:41 AM (UTC)

Amended on Thu 31 Jan 2013 01:58 AM (UTC) by Anaristos

Message
When I enter:

print(package.path)

I get this:

;.\?.lua;C:\MUSHclient\lua\?.lua;C:\MUSHclient\lua\?\init.lua;C:\MUSHclient\?.lua;C:\MUSHclient\?\init.lua;C:\Program Files (x86)\Lua\5.1\lua\?.luac;C:\CMUDPro334P\Aardwolf\Lua\?.lua

It is almost as if it scanned the drives for any folders with <filename>.lua in them and created a path. Though some of the folders don't exit, AFAIK.

EDIT:
OK, I see my mistake. Wrong variable.

print(package.cpath)

yields:

;;C:\Program Files (x86)\Lua\5.1\lua\?.dll;C:\Program Files (x86)\Lua\5.1\lua\?.lua;C:\Program Files (x86)\Lua\5.1\clibs\?.dll;C:\Program Files (x86)\Lua\5.1\clibs\luasql\?.dll;C:\dllcache\?.dll;C:\dllcache\LuaInterface_2.0.3\?.dll

So the place for both LuaInterface.dll and luanet.dll are in the cpath. That makes even less sense because if I run my code in the Lua command app, everything works fine. It also works when I call the code from CMUD, which uses the same LUA_CPATH variable.

Sic itur ad astra
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #11 on Thu 31 Jan 2013 05:39 AM (UTC)
Message
I sticky by reply #1 above. You need to see if any other DLLs are required, which the other DLLs need.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #12 on Thu 31 Jan 2013 05:40 AM (UTC)
Message
Let me expand a bit. Lua has gone through some version revisions, and more recently they changed stuff which meant that there was going to be "DLL hell".

The problem that you are having could easily be a side-effect of that. The thing you are trying to run may require different versions of DLLs (or different names) than are offered in the MUSHclient environment.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


40,092 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.