aarzilli / golua

Go bindings for Lua C API - in progress
MIT License
645 stars 161 forks source link

Windows linkage broken in MSYS2 #114

Closed KirkMcDonald closed 2 months ago

KirkMcDonald commented 2 months ago

Attempting to build against Lua 5.3 in an MSYS2 environment results in the error:

C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llua53: No such file or directory

But if I edit lua.go to make it link against -llua5.3 instead, then the linker succeeds.

Presumably the linker flags are written the way they are for a reason, and there is a different build environment for which they are correct. Is there a better solution than just editing the file to add the dot?

aarzilli commented 2 months ago

Unfortunately lua's shared object gets distributed with a variety of different names depending on operating system and distribution. The best I can do here is provide build flags to configure what library is used. In this case what you want is -tags lua53,lluadash.