-
Notifications
You must be signed in to change notification settings - Fork 25
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
lua-enet on Windows #1
Comments
I haven't personally built it on windows but I think someone else was successful. I have a working virtual machine now so I'll try to put together some binaries. From that error it sounds like you built enet into its own dll but not lua-enet. Lua is looking for a specially named function in the dll that it can't find. Is that a possibility? |
I really can't be sure. I did eventually get it working, although I honestly don't what specific steps that worked. I believe I built ENet using the provided Visual Studio project. I had to then modify the build commands that luarocks attempted to run to link to ws2_32 and winmm. I also had to modify an #ifdef WIN32 that for some reason wasn't being hit. It was attempting to include sys/time.h for the UNIX path. My working DLL was only a few hundred kb different in size than when I first posted the ticket. Although I was able to get the basic echo server/client to work, my main goal is to use the lib in conjunction with www.love2d.org. Attempting to load the module in a Love gets me "An application has made an attempt to load the C runtime library incorrectly" when I require enet. I'm not quite sure if this is a problem with the way I built it, or a problem with the Love stuff, but it's a definite blocker for me on using lua-enet further. I do believe I was able to get everything including loaded into Love2D on my Mac Mini, that was definitely straightforward compared to this. |
Okay I built a windows verison using mingw. I tested it with the echo servers and was able to require it in love without any errors. Give it a shot and tell me if it works. |
Fantastic, it seems to be working even within Love now. Was the build process under mingw significantly different from the "configure && make && make install" dance? Mainly if I need to dive into the wrapper source it would be nice to be able to generate a working binary myself. (BTW, do you know someone named Tim Branyen? He and I are both RIT alum, and he recognized the name when I linked him to the project! Small world.) |
It was pretty straight forward. I downloaded the enet source, then did Then from a checkout of lua-enet I ran:
There is no dependency on luarocks, I just used it for the lua binaries. You could easily use the Lua Binaries package too. I am actually trying to build love from scratch on windows. Now that is hard ;) (Also yeah I know Tim. I am also an RIT alum.) |
It's pretty old, but is there a luarocks fix? Any suggestions? |
DONT DO THIS, it's unfortunately not working, because there might be a version missmatch to ENet! If you stumble on this one, try the following: Use one of the .dlls @leafo mention here
For some reason 1.0-51 only worked for me. And load the c package as follows:
https://www.lua.org/manual/5.1/manual.html#5.3 see package.loadlib (libname, funcname) Therefore use the standard function name to load c packages: luaopen_[libraryname]. Line 775 in 97d91e8
|
9 days later, I found a solution to get the enet.dll running for my mod used in Noita. |
I've been attempting to get the bindings building and running on Windows, and haven't had much luck. I was able to get a .dll generated but upon attempting to run the echo server example Lua outputs the following:
-- server.lua
require "enet"
local host = enet.host_create"localhost:6789"
while true do
local event = host:service(100)
if event and event.type == "receive" then
print("Got message: ", event.data, event.peer)
event.peer:send(event.data)
end
end
lua: error loading module 'enet' from file '.\enet.dll':
The specified procedure could not be found.
stack traceback:
[C]: ?
[C]: in function 'require'
server\main.lua:2: in main chunk
[C]: ?
I imagine I'm doing something stupid while building. Are there any binaries existing for Windows that are confirmed working? I wasn't able to get it working through luarocks (couldn't find ENET_DIR despite it being set correctly) and had to manually build it within VS2005.
The text was updated successfully, but these errors were encountered: