Hi Jeff.
Thanks for this plugin first. I don't know much Lua yet but I'm sure it will be very useful.
hmmm... I never actually tried loading modules on Windows, it works fine on Linux. But I see now where it would be problematic.
Where do you put your modules in Linux? The libgeanylua that is produced there is also static, isn't it?
The problem is that geanylua links statically to 'liblua.a' but in order to load modules on Windows, it must (???) be re-compiled to link dynamically to lua51.dll instead.
I can compile a working geanylua statically with 'liblua5.1.a' but I'm not sure how to link dynamically using MingW. Is it -shared -llua5.1 then?
I don't know how well this will work with whatever version you are running, but you can try them if you want:
Thanks, but our DLLs apparently don't work with 0.14.
You will also need the "lua5_1_3_Win32_bin.zip" package from http://luaforge.net/projects/luabinaries/ in order to get the shared Lua DLL's.
I tried -shared -llua5.1. Then I put the lua-DLL into the Geany program dir. It apparently tries to load but then it complains about missing msvcr80.dll. When copying msvcr80.dll to the dir another error appears. Can it be that these DLLs are for MSVC only and cannot be used with MingW?
Am Fri, 25 Apr 2008 04:17:24 +0200 schrieb Andreas Mokros am@medienpensionat.com:
It apparently tries to load but then it complains about missing msvcr80.dll. When copying msvcr80.dll to the dir another error appears.
I compiled Lua with MingW now and with that dll it seems to work fine now.
Andreas Mokros am@medienpensionat.com wrote:
Where do you put your modules in Linux?
On Linux, they normally go in /usr/lib/lua/5.1/ (which is part of the default package.cpath)
The libgeanylua that is produced there is also static, isn't it?
Yes, but Lua modules on Linux don't need to link to the shared library at compile-time, they are able to resolve their symbols at load-time, from wherever the host app finds them.
I compiled Lua with MingW now and with that dll it seems to work fine now.
OK, that's good news!
I will try to come up with some solution for this for the next release of geanylua, although I'm not sure what the best option would be. Maybe the best thing is just to add some documentation explaining the situation and how to make it work.
- Jeff
Jeff Pohlmeyer wrote:
Yes, but Lua modules on Linux don't need to link to the shared library at compile-time, they are able to resolve their symbols at load-time, from wherever the host app finds them.
You mean you can load the modules from geanylua and they use the geany-functions in libgeanylua? Nice ...
I will try to come up with some solution for this for the next release of geanylua, although I'm not sure what the best option would be. Maybe the best thing is just to add some documentation explaining the situation and how to make it work.
I have put the Lua-dll and the modules in a separate directory now. The directory is in my PATH and it's also set as LUA_CPATH. I can load any module with require now.