forked from redo/BlockLua
1.8 KiB
1.8 KiB
Compiling on Windows with MSYS2 (32-bit)
Follow these steps to build BlockLua.dll for 32-bit Windows using MSYS2's MinGW-w64 i686 toolchain.
1) Install MSYS2
- Download and install MSYS2 from
https://www.msys2.org/. - After installing, open the "MSYS2 MSYS" terminal once and update the package database if prompted.
2) Install required packages (i686 / 32-bit)
Run this in the "MSYS2 MSYS" or "MSYS2 MinGW 32-bit" terminal:
pacman -Sy --needed mingw-w64-i686-toolchain mingw-w64-i686-binutils mingw-w64-i686-lua51
What these packages are for:
- mingw-w64-i686-toolchain: 32-bit C/C++ compiler suite (g++, libstdc++, runtime libs) to build Windows binaries.
- mingw-w64-i686-binutils: Linker and binary utilities (ld, as, objdump) used by the compiler and for optional inspection.
- mingw-w64-i686-lua51: Lua 5.1 development files for 32-bit (import library). We use its import library to link; at runtime you can use the provided
lua5.1.dll.
3) Build (PowerShell, recommended)
- Open PowerShell in the repo root.
- Run the script:
compile.bat
What the script does:
- Temporarily prepends
C:\\msys64\\mingw32\\binto PATH so the 32-bit toolchain is used. - Compiles the project with
-m32and links againstlua5.1. - Produces
build\BlockLua.dllandbuild\BlockLua-Unsafe.dll.
4) Optional: Verify 32-bit output
If you installed binutils, you can check the architecture:
objdump -f build\BlockLua.dll | Select-String i386
You should see architecture: i386 in the output.
Notes
- Ensure you installed the i686 (32-bit) variants of the packages; x86_64 packages won't work for a 32-bit build.
- If the linker cannot find
-llua5.1, confirmmingw-w64-i686-lua51is installed and you are using themingw32toolchain (notx86_64).