lua-users home
lua-l archive

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


Hi,

I'm trying to use LuaInferface with Lua 5.1.1 and I've run into a roadblock.

I tried using the binaries included with LuaInterface 1.3.0, but ran into a BadImageFormatException that I couldn't resolve. I decided that there was a good chance that I was running into either: (1) a .Net incompatibility of some sort with the LuaInterface dll and my system or (2) an architecture incompatibility - I'm on x64, which causes me all sorts of problems.

So I decided to build LuaInterface myself and make it work with my current Lua 5.1.1 setup. I've built lua 5.1.1 using VC++ Express and everything seems to be fine, I've compiled several C and C++ external libraries and everything seems to playing together nicely. Everything is built targeted for x86, so I'm hoping that should have eliminated any problems I was having due to architecture.

Now, I get yet another BadImageFormatException when I try to create a new Lua() instance. Basically, the C# program is (using VC# Express, targeting x86):

1  using System;
2  using LuaInterface;
3
4  namespace LuaCon
5  {
6      class Program
7      {
8          private bool bRunning = true;
9          public static Lua pLuaVM = null;
10
11         public Program()
12         {
13             pLuaVM = new Lua();
14         }
15
16         static void Main(string[] args)
17         {
18             Program pPrg = new Program();
19             pPrg.Run();
20         }
21     }
22 }

and it chokes on line 13, the Lua() invocation. At first it choked because LuaDLL.cs and Lua.cs in LuaInterface use lua_open which is only a definition in 5.1.1, but I replaced it with luaL_newstate and things got no better.

Anyone have any experience? ideas?

Thanks very much,

Ryan