Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

socket = require("socket") #1077

Closed
zmarotrix opened this issue Dec 19, 2017 · 14 comments
Closed

socket = require("socket") #1077

zmarotrix opened this issue Dec 19, 2017 · 14 comments

Comments

@zmarotrix
Copy link

On Windows, socket = require("socket") causes an error saying;

NLua.Exceptions.LuaScriptException: error loading module 'socket.core' from file '.\socket\core.dll':
    dynamic libraries not enabled; check your Lua installation

I've recompiled my Lua interpreter and made sure they are enabled. Does Bizhawk have a built-in Lua interpreter? If so, how can I update it?

@vadosnaprimer
Copy link
Contributor

Try luainterface instead of nlua. Somewhere in advanced config.

@zmarotrix
Copy link
Author

I got the same error.

@zmarotrix
Copy link
Author

Nevermind, I reloaded the Emulator and now I'm getting this:

NLua.Exceptions.LuaScriptException: error loading module 'socket.core' from file '.\socket\core.dll':
%1 is not a valid Win32 application.

@vadosnaprimer
Copy link
Contributor

You're obviously still using nlua, you need luainterface.

https://i.imgur.com/Dlc71c3.png

@zmarotrix
Copy link
Author

Weird, I have that option checked, restarted the emulator and all. I'm not sure what's going on.

@zmarotrix
Copy link
Author

Here are my settings
https://i.imgur.com/zc8tf4T.png

Here is the output
https://i.imgur.com/u8WDzXG.png

@vadosnaprimer
Copy link
Contributor

Yeah this is stupid. It seems to need @zeromus.

@zeromus
Copy link
Contributor

zeromus commented Dec 21, 2017

You cant just slop random lua plugins into bizhawk. See here for all the annoying complexities:

https://stackoverflow.com/questions/33428382/add-luasocket-to-program-bizhawk-shipped-with-own-lua-environment

Sounds like your bug is due to using a 32bit dll, anyway

@udoheld
Copy link
Contributor

udoheld commented Jan 15, 2018

I followed the instructions given on SO e.g.

/emuhawk.exe
/Lua (untouched)
/Socket/ftp.lua,http.lua,etc.
/ltn12.lua,socket.lua,mime.lua
/lua5.1.dll
/mytest.lua

I get the following error leaving out the "core.dll" as described:

NLua.Exceptions.LuaScriptException:
[string "main"]:2: module 'socket.core' not found:
no field package.preload['socket.core']
no file '.\socket\core.lua'
no file 'D:\emu\BizHawk-2.2.1\lua\socket\core.lua'
no file 'D:\emu\BizHawk-2.2.1\lua\socket\core\init.lua'
no file 'D:\emu\BizHawk-2.2.1\socket\core.lua'
no file 'D:\emu\BizHawk-2.2.1\socket\core\init.lua'
no file 'd:\Program Files (x86)\Lua\5.1\lua\socket\core.luac'
no file '.\socket\core.dll'
no file 'D:\emu\BizHawk-2.2.1\socket\core.dll'
no file 'D:\emu\BizHawk-2.2.1\loadall.dll'
no file '.\socket.dll'
no file 'D:\emu\BizHawk-2.2.1\socket.dll'
no file 'D:\emu\BizHawk-2.2.1\loadall.dll'

If I do put the "core.dll" from the download above into the socket folder it will complain:

NLua.Exceptions.LuaScriptException: error loading module 'socket.core' from file '.\socket\core.dll':
%1 is not a valid Win32 application.

@zeromus
Copy link
Contributor

zeromus commented Jan 15, 2018

You must also change the bizhawk setting to use luainterface instead of nlua

@udoheld
Copy link
Contributor

udoheld commented Jan 15, 2018

I changed that already and the config.ini reads (for both of my release and dev versions)

"UseNLua": false,

and when trying the current dev version it seems to pull load "LuaInterface.dll" at "EmuHawk.exe!BizHawk.Client.EmuHawk.Program.CurrentDomain_AssemblyResolve(object sender, System.ResolveEventArgs args) Line 347"
so I'd say it does that. And it should be the same for the released version.

The message is slightly different:

NLua.Exceptions.LuaScriptException:
error loading module 'socket.core' from file '.\socket\core.dll':
The specified module could not be found.

@udoheld
Copy link
Contributor

udoheld commented Jan 15, 2018

Ok. I noticed for dev the file structure has to be put into the "output" directory, but it now prints

NLua.Exceptions.LuaScriptException: error loading module 'socket.core' from file '.\socket\core.dll':
%1 is not a valid Win32 application.

as well.

@zeromus
Copy link
Contributor

zeromus commented Jan 15, 2018

ok, NOW the instructions on stackoverflow works.
Looks like even when you use luainterface all the errors and stuff say nlua, because lame reasons

@udoheld
Copy link
Contributor

udoheld commented Jan 16, 2018

Thx, it works for me now. @zmarotrix you may want to retry the daily build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants