lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


The first problem I had was to prevent the makefile
from building "usocket.c", and to use "wsocket.c"
Is there a compilation flag I missed ?

No...the makefile which comes with LuaSocket is for Linux/Unix; the Windows-flavoured build file is socket.vcproj.

You're not doing anything wrong -- you need to edit the makefile for MinGW. Change usocket.o to wsocket.o, and comment out the bit which builds $(UNIX_SO) since you don't get Unix domain sockets on Windows.

Also add -lws2_32 to the LDFLAGS= line in the 'config' file (in the root of the Luasocket distro), and add -DLUASOCKET_API=__declspec(dllexport) to the DEF= line.

Errr, I think you also need to change EXT=so to EXT=dll.

And if you plan to use 'make install', change the INSTALL_TOP settings to something Windowesque based on where Lua itself is installed.

(This from memory; you can check these facts by digging in [the XML mess that is] socket.vcproj :-)