Universal Lua

Started by
1 comment, last by ScEngMan 15 years, 4 months ago
Alright, here's the issue: Myself and a friend are working on a game, surprise surprise. We would like to embed scripting and have decided that Lua looks good. My friend enjoys developing in linux. Meanwhile, I am developing in windows. And in the end, we would like to be able to compile it naively for windows. My plan was to base everything on GNU tools and, in that way, maintain a cross-platform codebase using a simple makefile and either DJGPP or MinGW on my end. The problem is that it seems to be highly trivial to install Lua into a POSIX environment for windows such as msys or cygwin, but there seems to be no way that I can find to set it up to work properly with a vanilla windows toolchain that doesn't require an external POSIX dll or some such device to execute the resulting binary. That just seems wrong to me. I have managed to compile Lua under MinGW, but I cannot find a way to install the headers and libraries so that they link properly in a lua-based program. Really, it comes down to this: Does anyone know any good guides or similar material which covers setting up Lua to work with a windows native compiler (I'm pretty sure I'm going to stick with MinGW) that is not an IDE (such as BloodShed's Dev-Cpp because we would like the code to be completely and simply cross-platform)
Advertisement
You can download lua for windows from here , this will work with vc++ and Mingw(i've tested with both).
About IDEs and such. There is no reason to not use one. Code::blocks works in windows and linux as well.
And instead using native win32, you could use something like wxWidgets, it works on GTK, windows, mac os,... with native look and feel.
Hey Scribex,

Lua builds happily if you just insert all your files in a new Visual Studio project.

I'm building Lua in Visual Studio 2005 in two flavours, the lua5.1.exe, and an additional static library for building my extensions (dll libraries that add more functionality to Lua).

If you want to see a project doing this just download this SVN subfolder:
svn co https://sceneengine.svn.sourceforge.net/svnroot/sceneengine/trunk/extern/lua-5.1/ sceneengine

Or browse it:
http://sceneengine.svn.sourceforge.net/viewvc/sceneengine/trunk/extern/lua-5.1/
In browsing mode you can download the GNU Tarball.

And if you are working on Windows and your friend on Linux, maybe you want to take a look to CMake. CMake builds project files for almost everything from a few text files that tell it how to build it. In windows/visual_studio it builds the sln and vcproj files needed to compile the project.

Diego
CrackArthttp://www.crackart.orgOpen Source 3D Modeling and Texturing Application

This topic is closed to new replies.

Advertisement