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

Cannot require luacom #18

Open
Gyoraiyl opened this issue Jul 17, 2017 · 4 comments
Open

Cannot require luacom #18

Gyoraiyl opened this issue Jul 17, 2017 · 4 comments

Comments

@Gyoraiyl
Copy link

Every time i use
require("luacom")
It always drop an error says:

error loading module 'luacom' from file 'c:\program files (x86)\lua\5.3\lib\lua\5.3\luacom.dll'

but I do have the luacom.dll file in c:\program files (x86)\lua\5.3\lib\lua\5.3\ this directory.
I use luarocks to install luacom, other libraries installed by luarocks like luasocket or luafilesystem all working fine.
Dont know what's going on here :(

@moteus
Copy link

moteus commented Jul 17, 2017

This error means that Lua can find module file but it can not load it.
E.g. dll is for different arch (x64 but Lua is x86). Or if there no some deps (e.g. you have no needed runtime).
I belive if dll does not export correct function luaopen_luacom error message should be different.
And I hope you do not install binary rock which installed when you just type luarocks install luacom
Because in this case it install version for Lua 5.1 with deps from runtime from MSVC 2005.
LuaRocks can not provide different binaries for different Lua versions.
Try this one

luarocks install https://luarocks.org/manifests/luarocks/luacom-1.4-1.rockspec

But I fail compile original LuaCOM with luarocks so make my own pacakge.

luarocks install https://luarocks.org/manifests/moteus/luacom-scm.moteus-1.rockspec

@Gyoraiyl
Copy link
Author

Hi moteus,

Thanks a lot for your help.
But I got this error now when trying to install luacom by using this script

C:\Program Files (x86)\Lua\5.3>luarocks install https://luarocks.org/manifests/luarocks/luacom-1.4-1.rockspec
Warning: variable CFLAGS was not passed in build_variables
Makefile:73: *** missing separator. Stop.

Error: Build error: Failed building.

Got a same error when installing your package

C:\Program Files (x86)\Lua\5.3>luarocks install https://luarocks.org/manifests/moteus/luacom-scm.moteus-1.rockspec
Makefile.win:52: *** missing separator. Stop.

Error: Build error: Failed building.

I'm totally a newbee about this ,no idea what's the error means.

@moteus
Copy link

moteus commented Jul 18, 2017

Makefile:73: *** missing separator. Stop.

LuaCOM Make file compatiable with nmake from MSVC and fail for make from MinGW.
Not sure how hard is build LuaCOM with MinGW. And because rockspec for LuaCOM uses
this makefile as whell you have to use MSVC to build it.
I compile my rockspec with MSVC 2010/2015.

@robertlzj
Copy link

robertlzj commented Aug 24, 2018

I failed compile, too.
Using MSBuild Tool (stand alone package from Microsoft Visual Studio) with Makefile53.win.
Such as ..\luacom\source>nmake Makefile53.win all from 'Visual C++ 2015 x86 Native Build Tools Command Prompt'. Prompting:

.\src\library\luacom.cpp(2223): error C3861: 'luaL_register': identifier not found
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.

Maybe I need to set "Installation paths" said in Makefile53.win carefully, and get Lua 5.3 compiled first.

Currently, I get a complied binary version which satisfied my requirement - use in windows 10, support lua 5.3. File is from Zuume Scripting Engine at SourceForge.

Just share remarks here. Thanks~

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

3 participants