Skip to content

How to use mlua to compile 32-bit lua modules on the Windows 10 platform? Do you have any examples? #483

@YooMoonMoon

Description

@YooMoonMoon

Excuse me, sir!
My computer is Windows 10 64 bit, I‘m have installed with 64-bit Rust 1.82.0, and Lua5.1.5 is 32-bit. How should I compile it into a 32-bit DLL?
I have did the following settings:

  1. Set the target platform in the bottom right corner of RustRover to "i686-pc-windows-msvc".
  2. Modify the config file content in ".cargo" to:
    [target.i686-pc-windows-msvc]
    rustflags = [
    "-C", "link-arg=-undefined",
    "-C", "link-arg=dynamic_lookup",
    ]
  3. Using "cd F:\rust_lua_src\mlua-0.10.0\examples\module" to switch to the module directory in RustRover's command line.
  4. Enter git-bash.exe in the command line, and then show the "MINGW64:/f/rust_1ua_strc/mlua-0.10.0/sample/module" window.
  5. Using "LUA_INC=F:/rust_1ua_strc/lua51-x86/include LUA_LIB=F:/rust_1ua_strc/lua51-x86 LUA_LIBNAME=lua5.1 cargo build -- features lua51" to compile in the window.
    but I got an error:
    F: \ rust_1ua_Src \ lua51-x86 \ lua5.1.lib: warning LNK4272: The library computer type "x86" conflicts with the target computer type "x64".
    So,
    I have set the compilation platform to x86, but there are still errors and I don't know where the problem lies.
    If possible, can you answer for me?
    thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions