rust-lua53
rust-lua53 copied to clipboard
Compiling a dll on stable-x86_64-pc-windows-gnu fails to link functions correctly
When compiling a dll via cargo targeting stable-x86_64-pc-windows-gnu the linker fails to include the correct functions. Instead it only links lua funcitons in the dll.
I came across this when trying to compile the as-lua-lib example. The resultant dll only contains functions prefixed with "lua_", "luaL_", or "luaopen_". Notably missing is the "luaopen_mathx" function required for requiring the library from lua.
I can confirm that the same setup does indeed correctly link when the lua crate is omitted from the compilation. Likewise, the functions are included when compiling with the stable-x86_64-pc-windows-msvc target.
What happens if you change crate-type = ["dylib"]
to crate-type = ["cdylib"]
?
@retep998 I fear that compiling with the cdylib crate-type yields the same result