Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows mingw64, can not link to lua51.dll #58

Open
CanYellow opened this issue Jun 25, 2023 · 0 comments
Open

windows mingw64, can not link to lua51.dll #58

CanYellow opened this issue Jun 25, 2023 · 0 comments

Comments

@CanYellow
Copy link

platform

windows10, mingw64 with cmake

problem

  • building
    when using 'luarocks --tree luamodules install rapidjson', the ld.exe will throw a link error:
D:/ProgramFiles/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find D:ProgramFileslua51bin/lua51.dll: No such file or directory
  • config
    use default lua libdir setting. the config file is as follow:
variables = {
    MSVCRT = 'm',   -- make MinGW use MSVCRT.DLL as runtime
    LUALIB = 'lua51.dll',
    CC = [[D:\ProgramFiles\msys64\mingw64\bin\gcc.exe]],
    MAKE = [[D:\ProgramFiles\msys64\mingw64\bin\gnatmake.exe]],
    RC = [[D:\ProgramFiles\msys64\mingw64\bin\windres.exe]],
    LD = [[D:\ProgramFiles\msys64\mingw64\bin\gcc.exe]],
    AR = [[D:\ProgramFiles\msys64\mingw64\bin\ar.exe]],
    RANLIB = [[D:\ProgramFiles\msys64\mingw64\bin\ranlib.exe]],
}

solution

manual set the LUA_LIBDIR value. the config file is as follow:

variables = {
    MSVCRT = 'm',   -- make MinGW use MSVCRT.DLL as runtime
    LUALIB = 'lua51.dll',
    -- for cmake the default libdir string is 'D:/ProgramFiles/lua51/bin' which when attaching to ld.exe, it will parse as D:ProgramFileslua51bin. so manual config libdir as 'D:/ProgramFiles/lua51/bin'
    LUA_LIBDIR = 'D:/ProgramFiles/lua51/bin',
    CC = [[D:\ProgramFiles\msys64\mingw64\bin\gcc.exe]],
    MAKE = [[D:\ProgramFiles\msys64\mingw64\bin\gnatmake.exe]],
    RC = [[D:\ProgramFiles\msys64\mingw64\bin\windres.exe]],
    LD = [[D:\ProgramFiles\msys64\mingw64\bin\gcc.exe]],
    AR = [[D:\ProgramFiles\msys64\mingw64\bin\ar.exe]],
    RANLIB = [[D:\ProgramFiles\msys64\mingw64\bin\ranlib.exe]],
}

question

is there any improvement about the above problem in the furture rapidjson rocks update version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant