How to use LuaInterface in Mono / Linux

When I try to use LuaInterface in Mono on Linux (using Mono 2.0 on Ubuntu 9.04), I get the following exception:

** (App.exe: 8599): WARNING **: Method ': .DoDllLanguageSupportValidation ()' in assembly 
'/home/ulrich/test/Debug/lua51.dll' contains native code that cannot 
be executed by Mono on this platform. 
The assembly was probably created using C ++ / CLI.

According to this website, LuaInterface can be used with Mono. MoMA also talks about this.

Can I recompile lua51.dllto make it compatible with Mono?

+5
source share
3 answers

LuaInterface looks like pure C #, but uses a mixed version of the C ++ / CLI-ified version of Windows for its own Lua library, which mixes .NEt code and native 32-bit Windows code. There is no C ++ / CLI compiler for platforms other than Windows, so you cannot port / recompile C ++ / CLI code, although it should work on Mono on Win32 (or possibly Wine).

The only really viable way to get this to work on Mono is to get it to use P / Invokes istead from C ++ / CLI. You can then use dllmap so that when Mono tries to resolve P / Invoke calls to lua51.dll, it is redirected to the Linux equivalent, liblua.so.5.1.

+6
source

LuaInterface P/Invoke. .

, . http://github.com/jsimmons/LuaSharp

+6

For all of you reading this now: use KopiLuaInterface ! See my post here: fooobar.com/questions/1034024 / ...

0
source

All Articles