Couple noob Qs

Hi there. Could please someone explain couple simple things, just getting annoyed with my inability to solve it by myself.

  1. I install this version of Lua for Windows in let’s say C:\Lua

https://github.com/rjpcomputing/luaforwindows/releases

It has many built-in modules, via luarocks, i guess? I need some of them.

But my lua-scripts are working in specific application and there’s no way they will be put in this C:\Lua directory.

How should I correctly point in my scripts where to find them(modules)? In C:\Lua there’s many folders and

with that luarocks thing I don’t understand where are those modules. They’re in different folders? Or it’s just one.

Or maybe through luarocks i can solve this?

  1. Another thing is about luarocks, I guess. I want to have another one module, luaposix

https://github.com/luaposix/luaposix

How to install it to this Lua for Windows installation?

I mean before Lua for Windows I was trying luarocks alone and haven’t succeed, it needed Lua already.

I couldn’t even install Lua alone - thanks that guy who created Lua for Windows .exe and at least now I can use some modules in scripts when put in this directory.

I’ve tried to google it, read advices but still fail to do the right steps, though it’s the very beginning  :frowning:

I apologize in advance if there’s an explanation of this on the forum which I haven’t awared of obviously

Also it’s interesting has anyone tried luaposix on Win7x64. Does it work at all…

And I use Lua 5.1 if it’s important

Hi @nogery30. I hope some of our community developers can help you, but these forums are for developers who use Corona. Corona has Lua built in and Corona users don’t need to install Lua separately. Some of our developers might have experience that can help you, but you might have better luck on other Lua forums or Stackoverflow.

Rob 

I have recently installed Lua and Luarocks on Windows 7 64-bit.

Steps to install (globally) LuaRocks and Lua 5.1:

  1. Download luarocks-2.4.3-win32.zip from http://luarocks.github.io/luarocks/releases/,
  2. Unpack it to folder of your choose. For me it will be C:\Temp\luarocks,
  3. Download latest version of MinGW - A native Windows port of the GNU Compiler Collection (GCC) from https://sourceforge.net/projects/mingw/files/Installer/ If you have installed Visual Studio C++ you can omit this step and go to step 6. You will need cl.exe for VS C++ so make sure it works,
  4. Install MinGW in C:\MinGW,
  5. Add C:\MinGW\bin to %PATH% environment variable, 
  6. Enter ‘command’ in the search box at the bottom of the Start Menu and then click Command Prompt when it appears in the results.
  7. Run commands cd C: and cd C:\Temp\luarocks\luarocks-2.4.3-win32\luarocks-2.4.3-win32 ,
  8. Run install.bat /L /MW /F It will install LuaRocks+Lua 5.1 If you use VS C++ when remove flag /MW I’m not sure but you probably need to remove previous instalation of Lua before run script,
  9. Add C:\Program Files (x86)\LuaRocks to %PATH%,
  10. Create new environment variables:                                                                                                                  LUA_PATH=C:\Program Files (x86)\LuaRocks\lua?.lua;C:\Program Files (x86)\LuaRocks\lua?\init.lua;%APPDATA%\LuaRocks\share\lua\5.1?.lua;%APPDATA%\LuaRocks\share\lua\5.1?\init.lua;C:\Program Files (x86)\LuaRocks\systree\share\lua\5.1?.lua                              LUA_CPATH=%APPDATA%\LuaRocks\lib\lua\5.1?.dll;C:\Program Files (x86)\LuaRocks\systree\lib\lua\5.1?.dll;
  11. Delete C:\Temp\luarocks

To make sure it works enter commands  _luarocks and lua5.1 _in command prompt. You may have to change some folders names. 

For more information read: Installation instructions for Windows on luarocks github page. 

To install luaposix use

luarocks install luaposix

Sorry for english:) Good luck:)

ldurniat

Yes, man, thank you! That was very, very helpful!!

Now when I understand how to do it, it looks quite simple, well, at least not that difficult, but returning to the beginning, maaan… :smiley:

Actually I used for a while Lua for Windows installation but it has some inconveniences in my case.

This variant I like very much more. The only thing, I failed for now to make my MinGW work properly. But that’s ok, cl works fine for me.

As for luaposix, I can’t install it for some reason. If interested some can try it on MinGW, who knows, maybe 

it works there. It would be helpful to know.

But on cl I just can’t.

It says:

“luke: fatal: cannot find LDocs generator” 

And I actually installed ldoc and other dependencies. But still…

And that’s the only error.

In google I found only one similar topic https://github.com/gvvaughan/lyaml/issues/21

And it’s clearly not a “how to” for me, if it has something in common with a solution at all.

I just don’t have that level of understanding :slight_smile:

With MinGW compiler I get the same error message :( 

Since Windows 7 is non-POSIX system it may be not possible to install/use luaposix module. 

Try use cygwin to build luaposix module. This linkmay be useful for you. Good luck:)

ldurniat

Hi @nogery30. I hope some of our community developers can help you, but these forums are for developers who use Corona. Corona has Lua built in and Corona users don’t need to install Lua separately. Some of our developers might have experience that can help you, but you might have better luck on other Lua forums or Stackoverflow.

Rob 

I have recently installed Lua and Luarocks on Windows 7 64-bit.

Steps to install (globally) LuaRocks and Lua 5.1:

  1. Download luarocks-2.4.3-win32.zip from http://luarocks.github.io/luarocks/releases/,
  2. Unpack it to folder of your choose. For me it will be C:\Temp\luarocks,
  3. Download latest version of MinGW - A native Windows port of the GNU Compiler Collection (GCC) from https://sourceforge.net/projects/mingw/files/Installer/ If you have installed Visual Studio C++ you can omit this step and go to step 6. You will need cl.exe for VS C++ so make sure it works,
  4. Install MinGW in C:\MinGW,
  5. Add C:\MinGW\bin to %PATH% environment variable, 
  6. Enter ‘command’ in the search box at the bottom of the Start Menu and then click Command Prompt when it appears in the results.
  7. Run commands cd C: and cd C:\Temp\luarocks\luarocks-2.4.3-win32\luarocks-2.4.3-win32 ,
  8. Run install.bat /L /MW /F It will install LuaRocks+Lua 5.1 If you use VS C++ when remove flag /MW I’m not sure but you probably need to remove previous instalation of Lua before run script,
  9. Add C:\Program Files (x86)\LuaRocks to %PATH%,
  10. Create new environment variables:                                                                                                                  LUA_PATH=C:\Program Files (x86)\LuaRocks\lua?.lua;C:\Program Files (x86)\LuaRocks\lua?\init.lua;%APPDATA%\LuaRocks\share\lua\5.1?.lua;%APPDATA%\LuaRocks\share\lua\5.1?\init.lua;C:\Program Files (x86)\LuaRocks\systree\share\lua\5.1?.lua                              LUA_CPATH=%APPDATA%\LuaRocks\lib\lua\5.1?.dll;C:\Program Files (x86)\LuaRocks\systree\lib\lua\5.1?.dll;
  11. Delete C:\Temp\luarocks

To make sure it works enter commands  _luarocks and lua5.1 _in command prompt. You may have to change some folders names. 

For more information read: Installation instructions for Windows on luarocks github page. 

To install luaposix use

luarocks install luaposix

Sorry for english:) Good luck:)

ldurniat

Yes, man, thank you! That was very, very helpful!!

Now when I understand how to do it, it looks quite simple, well, at least not that difficult, but returning to the beginning, maaan… :smiley:

Actually I used for a while Lua for Windows installation but it has some inconveniences in my case.

This variant I like very much more. The only thing, I failed for now to make my MinGW work properly. But that’s ok, cl works fine for me.

As for luaposix, I can’t install it for some reason. If interested some can try it on MinGW, who knows, maybe 

it works there. It would be helpful to know.

But on cl I just can’t.

It says:

“luke: fatal: cannot find LDocs generator” 

And I actually installed ldoc and other dependencies. But still…

And that’s the only error.

In google I found only one similar topic https://github.com/gvvaughan/lyaml/issues/21

And it’s clearly not a “how to” for me, if it has something in common with a solution at all.

I just don’t have that level of understanding :slight_smile:

With MinGW compiler I get the same error message :( 

Since Windows 7 is non-POSIX system it may be not possible to install/use luaposix module. 

Try use cygwin to build luaposix module. This linkmay be useful for you. Good luck:)

ldurniat