lua-users home
lua-l archive

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




On Tue, Dec 8, 2009 at 5:24 PM, Doug Rogers <doug.rogers@elbitsystems-us.com> wrote:

I've been happily using my Lua + C bit string module in various Unix
environments. Now I'd like to add it to test code under Windows, using
LfW and os.execute() when any of our external programs are needed. Most
of what I need is already present (and working) in LfW; I just need to
compile my bstring C code in a manner suitable for use with it. We still
use VC++ 6.0 but I will happily download one of the Microsoft Express
packages.

I'd appreciate a link to a quick how-to for building LfW-compatible DLLs
and Lua modules. A pointer to the build process for one of the included
libraries will probably suffice.

I didn't see any developer info in the documentation for LfW 5.4.1.30
nor at http://luaforwindows.luaforge.net/. It's certainly possible that
I missed it. I had remembered a more recent discussion, but the latest
message that I found using the lual-l archive search was:

 http://lua-users.org/lists/lua-l/2008-08/msg00298.html

Are the instructions mentioned above still applicable? I see only
VC++-2008 Express at the referenced Microsoft web site (for convenience,
it's http://www.microsoft.com/express/download/2005, but that's
redirected). Do I use 2008, somehow targeted for the 2005 run-time?

Download Visual C++ 2005: http://go.microsoft.com/fwlink/?LinkId=51410&clcid=0x409

Download Visual C++ 2005 SP1 : http://download.microsoft.com/download/7/7/3/7737290f-98e8-45bf-9075-85cc6ae34bf1/vs80sp1-kb926748-x86-intl.exe

Now you can link against the Lua libraries the rest of modules are built against. by using '$(LUA_DEV)/include' (additional includes) and '$(LUA_DEV)/lib' (additional library paths).

Be very careful about embedding the manifest into the dll. You should turn that off unless you need it. otherwise you may have to manually manipulate (using a tool like ResourceHacker) the version number in the .dll to 762 to match the rest of the modules. Please Google for more information on the manifest subject. It sucks, but this seems to be the way to make it work when you can't control the binaries that come from third parties.

Hope that helps.
 
By the way, I have found LfW to be excellent. I love the debugging
capability. I only wish I had Emacs integrated with it - or an Emacs
mode in the Scite editor. At least I can use the File -> Revert to get
changes when I use Emacs for longer editing sessions. I've been bitten
once by the fact that Ctrl-S (or File -> Save) does not check whether
the file on disk has changed since the last time it was opened/saved by
Scite.

Thanks for an outstanding piece of free software!

You are very welcome.
--
Regards,
Ryan